package st.gravel.support.compiler.ast;
/*
This file is automatically generated from typed smalltalk source. Do not edit by hand.
(C) AG5.com
*/
import java.math.BigInteger;
import st.gravel.support.jvm.NonLocalReturn;
import st.gravel.support.compiler.ast.Node;
import st.gravel.support.compiler.ast.Node.Node_Factory;
import st.gravel.support.compiler.ast.NodeVisitor;
import st.gravel.support.compiler.ast.ClassTypeNode;
import st.gravel.support.compiler.ast.TypeDefNode;
import st.gravel.support.compiler.ast.TypeOrNode;
import st.gravel.support.compiler.ast.SourcePrinter;
import st.gravel.support.compiler.ast.SourcePosition;
abstract public class TypeNode extends Node implements Cloneable {
public static TypeNode_Factory factory = new TypeNode_Factory();
public static class TypeNode_Factory extends Node_Factory {
public TypeNode basicNew() {
throw new RuntimeException("TypeNode is an abstract class");
}
}
public TypeNode $pipe$(final TypeNode _aTypeNode) {
if (st.gravel.support.jvm.ObjectExtensions.equals_(this, _aTypeNode)) {
return TypeNode.this;
}
return TypeOrNode.factory.left_right_(this, _aTypeNode);
}
@Override
public <X> X accept_(final NodeVisitor<X> _visitor) {
return _visitor.visitTypeNode_(this);
}
@Override
public TypeNode allNodesDo_(final st.gravel.support.jvm.Block1<Object, Node> _aBlock) {
this.nodesDo_(new st.gravel.support.jvm.Block1<Object, Node>() {
@Override
public Object value_(final Node _each) {
return _each.withAllNodesDo_(_aBlock);
}
});
return this;
}
@Override
public TypeNode allNodesDo_pruneWhere_(final st.gravel.support.jvm.Block1<Object, Node> _aBlock, final st.gravel.support.jvm.Block1<Boolean, Node> _pruneBlock) {
this.nodesDo_(new st.gravel.support.jvm.Block1<Object, Node>() {
@Override
public Object value_(final Node _each) {
if (!_pruneBlock.value_(_each)) {
return _each.withAllNodesDo_pruneWhere_(_aBlock, _pruneBlock);
}
return TypeNode.this;
}
});
return this;
}
public ClassTypeNode asClassTypeNode() {
return ClassTypeNode.factory.node_(this);
}
public TypeDefNode asDefNode() {
return TypeDefNode.factory.node_(this);
}
public TypeNode copy() {
try {
TypeNode _temp1 = (TypeNode) this.clone();
_temp1.postCopy();
return _temp1;
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
}
@Override
public boolean equals(final Object _anObject) {
if (!super.equals(_anObject)) {
return false;
}
return true;
}
public TypeNode_Factory factory() {
return factory;
}
public abstract TypeNode innerSourceOn_(final StringBuilder _aStream);
public boolean isNilType() {
return false;
}
public boolean isOptional() {
return false;
}
@Override
public TypeNode localVarNamesDo_(final st.gravel.support.jvm.Block1<Object, String> _aBlock) {
return this;
}
public TypeNode mandatory() {
return this;
}
@Override
public TypeNode nodesDo_(final st.gravel.support.jvm.Block1<Object, Node> _aBlock) {
return this;
}
@Override
public TypeNode prettySourceOn_(final StringBuilder _aStream) {
SourcePrinter.factory.on_(_aStream).visit_(this);
return this;
}
@Override
public TypeNode printOn_(final StringBuilder _aStream) {
final String _title;
_title = this.factory().toString();
_aStream.append(st.gravel.support.jvm.CharacterExtensions.isVowel(_title.charAt(0)) ? "an " : "a ");
_aStream.append(_title);
_aStream.append('[');
this.sourceOn_(_aStream);
_aStream.append(']');
return this;
}
@Override
public TypeNode pvtSetSourcePosition_(final SourcePosition _aSourcePosition) {
_sourcePosition = _aSourcePosition;
return this;
}
@Override
public TypeNode sourceOn_(final StringBuilder _aStream) {
this.innerSourceOn_(_aStream);
return this;
}
public abstract TypeNode typeDefsDo_(final st.gravel.support.jvm.Block1<Object, TypeNode> _aBlock);
@Override
public TypeNode withAllNodesDo_(final st.gravel.support.jvm.Block1<Object, Node> _aBlock) {
_aBlock.value_(this);
this.allNodesDo_(_aBlock);
return this;
}
@Override
public TypeNode withAllNodesDo_pruneWhere_(final st.gravel.support.jvm.Block1<Object, Node> _aBlock, final st.gravel.support.jvm.Block1<Boolean, Node> _pruneBlock) {
_aBlock.value_(this);
this.allNodesDo_pruneWhere_(_aBlock, _pruneBlock);
return this;
}
@Override
public TypeNode withSourcePosition_(final SourcePosition _aSourcePosition) {
if (_sourcePosition == _aSourcePosition) {
return TypeNode.this;
}
return this.copy().pvtSetSourcePosition_(_aSourcePosition);
}
}