|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectscale.common.Root
scale.score.Note
scale.score.chords.Chord
scale.score.chords.SequentialChord
scale.score.chords.MarkerChord
public class MarkerChord
This class represents a "marker" node in the CFG.
$Id: MarkerChord.java,v 1.2 2007-03-21 13:32:12 burrill Exp $
Copyright 2007 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
A marker records some information needed by the compiler. No code may generated for the node.
| Field Summary |
|---|
| Fields inherited from class scale.score.chords.Chord |
|---|
lineNumber |
| Constructor Summary | |
|---|---|
MarkerChord(java.lang.Object object,
long flags)
Create a MarkerChord. |
|
MarkerChord(java.lang.Object object,
long flags,
Chord next)
Create a MarkerChord. |
|
| Method Summary | |
|---|---|
Chord |
copy()
Make a copy of this CFG node with the same out-going CFG edges. |
DColor |
getDisplayColorHint()
Return a String specifying the color to use for coloring this node in a graphical display. |
long |
getFlags()
|
java.lang.Object |
getObject()
|
boolean |
isMarker()
Return true if this is a marker chord. |
boolean |
isSpecial()
Return true if this is chord was added for the convenience of the compiler and does not correspond to actual source code in the user program. |
void |
visit(Predicate pred)
Process a node by calling its associated routine. |
| Methods inherited from class scale.score.Note |
|---|
getChord, getEssentialUse, setAnnotationLevel, setReportLevel, toString, validate |
| Methods inherited from class scale.common.Root |
|---|
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayName, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, hashCode, removeAnnotation, removeAnnotations, toStringAnnotations, toStringClass, trace, trace, trace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MarkerChord(java.lang.Object object,
long flags,
Chord next)
object - is some Object or nullflags - specifies the flags of marker
public MarkerChord(java.lang.Object object,
long flags)
object - is some Object or nullflags - specifies the flags of marker| Method Detail |
|---|
public final long getFlags()
public final java.lang.Object getObject()
public Chord copy()
Chord
copy in class Chordpublic void visit(Predicate pred)
Note
Each class has a visit(Predicate p) method. For
example, in class ABC:
public void visit(Predicate p)
{
p.visitABC(this);
}
and the class that implements Predicate has a method
public void visitABC(Note n)
{
ABC a = (ABC) n;
...
}
Thus, the class that implements Predicate can call
n.visit(this);where
n is a Note sub-class without
determining which specific sub-class n is.
The visit pattern basically avoids implementing a large
switch statement or defining different methods
in each class for some purpose.
visit in class NotePredicatepublic final boolean isSpecial()
isSpecial in class Chordpublic final boolean isMarker()
isMarker in class Chordpublic DColor getDisplayColorHint()
getDisplayColorHint in interface DisplayNodegetDisplayColorHint in class ChordDColor
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||