001    // Synthesized and inherited attributes. Parameterized attributes.
002    // See section 3.6 in the paper.
003    // Reference manual: http://jastadd.org/
004    
005    aspect NameAnalysis {
006      syn State Transition.source() = lookup(getSourceLabel()); // R1
007      syn State Transition.target() = lookup(getTargetLabel()); // R2
008      inh State Declaration.lookup(String label); // R3
009        
010      eq StateMachine.getDeclaration(int i).lookup(String label) { // R4
011        for (Declaration d : getDeclarationList()) {
012          State match = d.localLookup(label);
013          if (match != null) return match;
014        }
015        return null;
016      }
017        
018      syn State Declaration.localLookup(String label) = null; // R5
019        
020      eq State.localLookup(String label) = // R6
021          (label.equals(getLabel())) ? this : null;
022    }