001 package edu.rice.cs.javalanglevels.tree;
002
003 import edu.rice.cs.javalanglevels.SourceInfo;
004
005 /**
006 * Class JExpression, a component of the JExpressionIF composite hierarchy.
007 * Note: null is not allowed as a value for any field.
008 * @version Generated automatically by ASTGen at Sun Mar 04 23:01:28 CST 2012
009 */
010 public abstract class JExpression extends Object implements JExpressionIF {
011 private final SourceInfo _sourceInfo;
012 private int _hashCode;
013 private boolean _hasHashCode = false;
014
015 /**
016 * Constructs a JExpression.
017 * @throws java.lang.IllegalArgumentException If any parameter to the constructor is null.
018 */
019 public JExpression(SourceInfo in_sourceInfo) {
020 super();
021
022 if (in_sourceInfo == null) {
023 throw new java.lang.IllegalArgumentException("Parameter 'sourceInfo' to the JExpression constructor was null. This class may not have null field values.");
024 }
025 _sourceInfo = in_sourceInfo;
026 }
027
028 public SourceInfo getSourceInfo() { return _sourceInfo; }
029
030 public abstract <RetType> RetType visit(JExpressionIFVisitor<RetType> visitor);
031 public abstract void visit(JExpressionIFVisitor_void visitor);
032 public abstract void outputHelp(TabPrintWriter writer);
033 protected abstract int generateHashCode();
034 public final int hashCode() {
035 if (! _hasHashCode) { _hashCode = generateHashCode(); _hasHashCode = true; }
036 return _hashCode;
037 }
038 }