Changeset 9609


Ignore:
Timestamp:
Feb 6, 2017 7:48:10 AM (3 years ago)
Author:
Zimon Kuhs
Message:

#5284

Updated JastAdd to version 2.2.2.

Some changes were required:

  • Flag in build-base.
  • Iterator implementation for ASTNode.
  • Removal of two equations and a package declaration.
  • Removing use of the field 'child' in a lookup equation.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/ModelicaFrontEnd/src/jastadd/instance/InstLookupClasses.jrag

    r9518 r9609  
    117117    inh InstLookupResult<InstClassDecl> InstExtendsShortClass.lookupInstClassInChain(String name);
    118118    inh InstLookupResult<InstClassDecl> InstReplacingExtendsShortClass.lookupInstClassInChain(String name);
    119     // Default to using normal lookup
    120     // TODO: don't use JastAdd internal stuff (child)
    121     eq InstNode.getChild().lookupInstClassInChain(String name)                             =
    122         ((InstNode) child).lookupInstClass(name);
     119
     120    /*
     121     * Default to using normal lookup.
     122     */
     123    eq List.getChild(int index).lookupInstClassInChain(String name) {
     124        InstLookupResult<InstClassDecl> result = null;
     125        for (ASTNode child : this) {
     126            result = ((InstNode) child).lookupInstClass(name);
     127            if (result.successful()) {
     128                return result;
     129            }
     130        }
     131        return result;
     132    }
     133    eq InstNode.getChild(int index).lookupInstClassInChain(String name) {
     134        return ((InstNode) getChild(index)).lookupInstClass(name);
     135    }
    123136    eq InstRecordConstructor.getInstComponentDecl().lookupInstClassInChain(String name)    =
    124137        myInstClassDecl().genericLookupInstClass(name);
  • trunk/Compiler/ModelicaFrontEnd/src/jastadd/instance/InstanceTree.jrag

    r9601 r9609  
    935935    syn InstNode InstClassRedeclare.instLookupNodeForShortClassExtends() = myInstNode();
    936936
    937     eq InstPrimitive.getInstComponentDeclList() = new List();
    938     eq InstPrimitive.getInstClassDeclList() = new List();
    939 
    940     syn InstComponentDecl InstRecordConstructor.getInstComponentDeclNoTransform(int i) =
    941         getInstComponentDeclListNoTransform().getChildNoTransform(i);
    942     syn InstExtends InstRecordConstructor.getInstExtendsNoTransform(int i) =
    943         getInstExtendsListNoTransform().getChildNoTransform(i);
     937    eq InstPrimitive.getInstComponentDeclList() = new List();
     938    eq InstPrimitive.getInstClassDeclList() = new List();
    944939
    945940    syn nta List<InstComponentDecl> InstRecordConstructor.getInstComponentDeclList() {
  • trunk/Compiler/ModelicaFrontEnd/src/jastadd/util/Util.jrag

    r9605 r9609  
    261261
    262262aspect NodeMethods {
    263      
     263
     264    public class ASTNode<T extends ASTNode> implements Iterable<T> {
     265        @Override
     266        public Iterator<T> iterator() {
     267            return astChildIterator();
     268        }
     269    }
     270
    264271    public class ASTNode {
    265272        /**
  • trunk/Compiler/ModelicaMiddleEnd/src/jastadd/structural/Graphs.jadd

    r9525 r9609  
    1414*/
    1515
    16 package org.jmodelica.util;
    1716import java.util.ArrayList;
    1817import java.util.Collection;
  • trunk/Compiler/build-base.xml

    r9497 r9609  
    531531                    <arg value="--lazyMaps" />
    532532                    <arg value="--indent=4space" />
     533                    <arg value="--inhEqCheck=false" />
    533534                    <arg line="${jastadd_files}" />
    534535                </java>
Note: See TracChangeset for help on using the changeset viewer.