net.sf.smc
Class SmcElement

java.lang.Object
  extended by net.sf.smc.SmcElement
Direct Known Subclasses:
SmcAction, SmcFSM, SmcGuard, SmcMap, SmcParameter, SmcState, SmcTransition

public abstract class SmcElement
extends java.lang.Object

The super class for all abstract syntax tree elements. Provides the interface for the visitor classes. See the Visitor pattern in GoF (p. 331).

See Also:
SmcFSM, SmcMap, SmcState, SmcTransition, SmcGuard, SmcAction, SmcParameter, SmcVisitor

Field Summary
 int _lineNumber
          An element starts on a particular line number.
protected  java.lang.String _name
          An element has a unique name.
 
Constructor Summary
protected SmcElement(java.lang.String name, int lineNumber)
          Default constructor.
 
Method Summary
abstract  void accept(SmcVisitor visitor)
          Accepts a new visitor which performs some action upon this abstract syntax tree element.
 int getLineNumber()
          Returns the element's position in the .sm file.
 java.lang.String getName()
          Returns the element's unique name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_name

protected final java.lang.String _name
An element has a unique name.


_lineNumber

public final int _lineNumber
An element starts on a particular line number.

Constructor Detail

SmcElement

protected SmcElement(java.lang.String name,
                     int lineNumber)
Default constructor.

Parameters:
name - the elements unique name.
lineNumber - where this element appears in the .sm file.
Method Detail

getName

public java.lang.String getName()
Returns the element's unique name.

Returns:
the element's unique name.

getLineNumber

public int getLineNumber()
Returns the element's position in the .sm file.

Returns:
the element's position in the .sm file.

accept

public abstract void accept(SmcVisitor visitor)
Accepts a new visitor which performs some action upon this abstract syntax tree element.

Parameters:
visitor - a parser visitor.