JAVA
1
JAVA
2
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ArrayAccess.class, "name", VariableBase.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new SimplePropertyDescriptor(ArrayAccess.class, "isDollared", Boolean.class, OPTIONAL)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ArrayAccess.class, "index", Expression.class, OPTIONAL, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new SimplePropertyDescriptor(ArrayAccess.class, "arrayType", Integer.class, OPTIONAL)
JAVA
return ArrayAccess.NAME_PROPERTY;
JAVA
return ArrayAccess.DOLLARED_PROPERTY;
JAVA
super(ast);
JAVA
super(start, end, ast, variableName);
if (index != null) {
setIndex(index);
}
setArrayType(arrayType);
JAVA
super(start, end, ast, variableName);
if (index != null) {
setIndex(index);
}
JAVA
getName().accept(visitor);
if (index != null) {
index.accept(visitor);
}
JAVA
accept(visitor);
getName().traverseTopDown(visitor);
if (index != null) {
index.traverseTopDown(visitor);
}
JAVA
getName().traverseBottomUp(visitor);
if (index != null) {
index.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ArrayAccess");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" type='").append(getArrayType(arrayType)).append("'>\n");
getName().toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("<Index>\n");
if (index != null) {
index.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</Index>\n");
//$NON-NLS-1$
buffer.append(tab).append("</ArrayAccess>");
JAVA
switch(type) {
case VARIABLE_ARRAY:
return //$NON-NLS-1$
"array";
case VARIABLE_HASHTABLE:
return //$NON-NLS-1$
"hashtable";
default:
throw new IllegalArgumentException();
}
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
return ASTNode.ARRAY_ACCESS;
JAVA
return index;
JAVA
if (index == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.index;
preReplaceChild(oldChild, index, INDEX_PROPERTY);
this.index = index;
postReplaceChild(oldChild, index, INDEX_PROPERTY);
JAVA
if (property == INDEX_PROPERTY) {
if (get) {
return getIndex();
} else {
setIndex((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
return arrayType;
JAVA
if (getArrayType(value) == null) {
throw new IllegalArgumentException();
}
preValueChange(ARRAY_TYPE_PROPERTY);
this.arrayType = value;
postValueChange(ARRAY_TYPE_PROPERTY);
JAVA
if (property == ARRAY_TYPE_PROPERTY) {
if (get) {
return getArrayType();
} else {
setArrayType(value);
return 0;
}
}
// allow default implementation to flag the error
return super.internalGetSetIntProperty(property, get, value);
JAVA
super.setName(variableName);
JAVA
return (VariableBase) super.getName();
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final VariableBase expr = ASTNode.copySubtree(target, getName());
final Expression index = ASTNode.copySubtree(target, getIndex());
final int type = getArrayType();
final ArrayAccess result = new ArrayAccess(getStart(), getEnd(), target, expr, index, type);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ChildPropertyDescriptor(Variable.class, "name", Expression.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(Variable.class, "isDollared", Boolean.class, //$NON-NLS-1$
OPTIONAL)
JAVA
return Variable.NAME_PROPERTY;
JAVA
return Variable.DOLLARED_PROPERTY;
JAVA
super(start, end, ast);
if (variableName == null) {
throw new IllegalArgumentException();
}
setName(variableName);
setIsDollared(isDollared);
JAVA
this(start, end, ast, variableName, false);
JAVA
this(start, end, ast, createIdentifier(start, end, ast, variableName), checkIsDollared(variableName));
JAVA
super(ast);
JAVA
return variableName.indexOf('$') == 0;
JAVA
if (checkIsDollared(idName)) {
idName = idName.substring(1);
// the start position move after the the dollar mark
start++;
}
return new Identifier(start, end, ast, idName);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
name.accept(visitor);
JAVA
accept(visitor);
name.traverseTopDown(visitor);
JAVA
name.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<Variable");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" isDollared='").append(isDollared).append("'>\n");
name.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</Variable>");
JAVA
return ASTNode.VARIABLE;
JAVA
return isDollared;
JAVA
final SimplePropertyDescriptor dollaredProperty = getDollaredProperty();
preValueChange(dollaredProperty);
this.isDollared = value;
postValueChange(dollaredProperty);
JAVA
return name;
JAVA
return name;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.name;
final ChildPropertyDescriptor nameProperty = getNameProperty();
preReplaceChild(oldChild, expression, nameProperty);
this.name = expression;
postReplaceChild(oldChild, expression, nameProperty);
JAVA
if (property == getNameProperty()) {
if (get) {
return getName();
} else {
setName((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
if (property == getDollaredProperty()) {
if (get) {
return isDollared();
} else {
setIsDollared(value);
return false;
}
}
// allow default implementation to flag the error
return super.internalGetSetBooleanProperty(property, get, value);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final boolean dollared = isDollared();
final Expression name = ASTNode.copySubtree(target, getName());
final Variable result = new Variable(getStart(), getEnd(), target, name, dollared);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
super(start, end, ast);
JAVA
super(ast);
JAVA
final int type = getType();
if (type != ASTNode.SCALAR && type != ASTNode.UNARY_OPERATION && type != ARRAY_CREATION) {
return false;
}
// check the context of the expression
final ASTNode parent = getParent();
if (parent == null) {
return false;
}
final int parentType = parent.getType();
// check - formal parameter and declare statement
if (parentType == ASTNode.FORMAL_PARAMETER || parentType == ASTNode.DECLARE_STATEMENT || parentType == ASTNode.CONSTANT_DECLARATION) {
return true;
}
// check - static statement
if (parentType == ASTNode.ASSIGNMENT) {
final ASTNode grandpa = parent.getParent();
if (grandpa == null) {
return false;
}
if (grandpa.getType() == ASTNode.STATIC_STATEMENT) {
return true;
}
return false;
}
// are static scalars. like static $a = array( '5' => 4 )
if (parentType == ASTNode.ARRAY_ELEMENT) {
final ASTNode grandpa = parent.getParent();
if (grandpa == null || grandpa.getType() != ASTNode.ARRAY_CREATION) {
return false;
}
Expression grandpaExpression = (Expression) grandpa;
return grandpaExpression.isStaticScalar();
}
// check recursively for static scalars
if (parentType == ASTNode.SCALAR || parentType == ASTNode.UNARY_OPERATION || parentType == ARRAY_CREATION) {
final Expression parentExpression = (Expression) parent;
return parentExpression.isStaticScalar();
}
return false;
JAVA
if (getType() == ASTNode.SCALAR) {
final Scalar scalar = (Scalar) this;
if (//$NON-NLS-1$
scalar.getScalarType() == Scalar.TYPE_STRING && scalar.getStringValue().equalsIgnoreCase("null")) {
return true;
}
}
return false;
JAVA
super(nodeClass, propertyId);
if (childType == null || !ASTNode.class.isAssignableFrom(childType)) {
throw new IllegalArgumentException();
}
this.childClass = childType;
this.mandatory = mandatory;
this.cycleRisk = cycleRisk;
JAVA
return this.childClass;
JAVA
return this.mandatory;
JAVA
return this.cycleRisk;
JAVA
super(nodeClass, propertyId);
if (valueType == null || ASTNode.class.isAssignableFrom(valueType)) {
throw new IllegalArgumentException();
}
this.valueType = valueType;
this.mandatory = mandatory;
JAVA
return this.valueType;
JAVA
return this.mandatory;
JAVA
if (nodeClass == null || propertyId == null) {
throw new IllegalArgumentException();
}
this.propertyId = propertyId;
this.nodeClass = nodeClass;
JAVA
return this.propertyId;
JAVA
return this.nodeClass;
JAVA
return (this instanceof SimplePropertyDescriptor);
JAVA
return (this instanceof ChildPropertyDescriptor);
JAVA
return (this instanceof ChildListPropertyDescriptor);
JAVA
StringBuffer b = new StringBuffer();
if (isChildListProperty()) {
//$NON-NLS-1$
b.append("ChildList");
}
if (isChildProperty()) {
//$NON-NLS-1$
b.append("Child");
}
if (isSimpleProperty()) {
//$NON-NLS-1$
b.append("Simple");
}
//$NON-NLS-1$
b.append("Property[");
if (this.nodeClass != null) {
b.append(this.nodeClass.getName());
}
//$NON-NLS-1$
b.append(",");
if (this.propertyId != null) {
b.append(this.propertyId);
}
//$NON-NLS-1$
b.append("]");
return b.toString();
JAVA
new NodeEventHandler()
JAVA
0
JAVA
0
JAVA
0
JAVA
new Object()
JAVA
0
JAVA
new Class[] { AST.class }
JAVA
new Object[] { this }
JAVA
0x80000000
JAVA
this.useASPTags = aspTagsAsPhp;
this.apiLevel = apiLevel;
this.lexer = getLexerInstance(reader, apiLevel, aspTagsAsPhp, useShortTags);
this.parser = getParserInstance(apiLevel, this.lexer);
JAVA
if (PHPVersion.PHP4 == phpVersion) {
final AstLexer lexer4 = getLexer4(reader);
lexer4.setUseAspTagsAsPhp(aspTagsAsPhp);
lexer4.setUseShortTags(useShortTags);
return lexer4;
} else if (PHPVersion.PHP5 == phpVersion) {
final AstLexer lexer5 = getLexer5(reader);
lexer5.setUseAspTagsAsPhp(aspTagsAsPhp);
lexer5.setUseShortTags(useShortTags);
return lexer5;
} else if (PHPVersion.PHP5_3 == phpVersion) {
final AstLexer lexer53 = getLexer53(reader);
lexer53.setUseAspTagsAsPhp(aspTagsAsPhp);
lexer53.setUseShortTags(useShortTags);
return lexer53;
} else if (PHPVersion.PHP5_4 == phpVersion) {
final AstLexer lexer54 = getLexer54(reader);
lexer54.setUseAspTagsAsPhp(aspTagsAsPhp);
lexer54.setUseShortTags(useShortTags);
return lexer54;
} else {
throw new IllegalArgumentException(//$NON-NLS-1$
CoreMessages.getString(//$NON-NLS-1$
"ASTParser_1") + phpVersion);
}
JAVA
final org.eclipse.php.internal.core.ast.scanner.php54.PhpAstLexer phpAstLexer5 = new org.eclipse.php.internal.core.ast.scanner.php54.PhpAstLexer(reader);
phpAstLexer5.setAST(this);
return phpAstLexer5;
JAVA
final org.eclipse.php.internal.core.ast.scanner.php53.PhpAstLexer phpAstLexer5 = new org.eclipse.php.internal.core.ast.scanner.php53.PhpAstLexer(reader);
phpAstLexer5.setAST(this);
return phpAstLexer5;
JAVA
final org.eclipse.php.internal.core.ast.scanner.php5.PhpAstLexer phpAstLexer5 = new org.eclipse.php.internal.core.ast.scanner.php5.PhpAstLexer(reader);
phpAstLexer5.setAST(this);
return phpAstLexer5;
JAVA
final org.eclipse.php.internal.core.ast.scanner.php4.PhpAstLexer phpAstLexer4 = new org.eclipse.php.internal.core.ast.scanner.php4.PhpAstLexer(reader);
phpAstLexer4.setAST(this);
return phpAstLexer4;
JAVA
if (PHPVersion.PHP4 == phpVersion) {
final org.eclipse.php.internal.core.ast.scanner.php4.PhpAstParser parser = new org.eclipse.php.internal.core.ast.scanner.php4.PhpAstParser(lexer);
parser.setAST(this);
return parser;
} else if (PHPVersion.PHP5 == phpVersion) {
final org.eclipse.php.internal.core.ast.scanner.php5.PhpAstParser parser = new org.eclipse.php.internal.core.ast.scanner.php5.PhpAstParser(lexer);
parser.setAST(this);
return parser;
} else if (PHPVersion.PHP5_3 == phpVersion) {
final org.eclipse.php.internal.core.ast.scanner.php53.PhpAstParser parser = new org.eclipse.php.internal.core.ast.scanner.php53.PhpAstParser(lexer);
parser.setAST(this);
return parser;
} else if (PHPVersion.PHP5_4 == phpVersion) {
final org.eclipse.php.internal.core.ast.scanner.php54.PhpAstParser parser = new org.eclipse.php.internal.core.ast.scanner.php54.PhpAstParser(lexer);
parser.setAST(this);
return parser;
} else {
throw new IllegalArgumentException(//$NON-NLS-1$
CoreMessages.getString(//$NON-NLS-1$
"ASTParser_1") + phpVersion);
}
JAVA
return this.modificationCount;
JAVA
// and the modification count will not be increased
if (this.disableEvents > 0) {
return;
}
// increase the modification count
this.modificationCount++;
JAVA
synchronized (this.internalASTLock) {
// guard against concurrent access by another reader
this.disableEvents++;
}
// while disableEvents > 0 no events will be reported, and mod count
// will stay fixed
JAVA
synchronized (this.internalASTLock) {
// guard against concurrent access by another reader
this.disableEvents--;
}
JAVA
// IMPORTANT: this method is called by readers during lazy init
synchronized (this.internalASTLock) {
// guard against concurrent access by a reader doing lazy init
if (this.disableEvents > 0) {
// System.out.println("[BOUNCE DEL]");
return;
} else {
disableEvents();
}
}
try {
this.eventHandler.preRemoveChildEvent(node, child, property);
// N.B. even if event handler blows up, the AST is not
// corrupted since node has not been changed yet
} finally {
reenableEvents();
}
JAVA
// IMPORTANT: this method is called by readers during lazy init
synchronized (this.internalASTLock) {
// guard against concurrent access by a reader doing lazy init
if (this.disableEvents > 0) {
// System.out.println("[BOUNCE DEL]");
return;
} else {
disableEvents();
}
}
try {
this.eventHandler.postRemoveChildEvent(node, child, property);
// N.B. even if event handler blows up, the AST is not
// corrupted since node has not been changed yet
} finally {
reenableEvents();
}
JAVA
// IMPORTANT: this method is called by readers during lazy init
synchronized (this.internalASTLock) {
// guard against concurrent access by a reader doing lazy init
if (this.disableEvents > 0) {
// System.out.println("[BOUNCE REP]");
return;
} else {
disableEvents();
}
}
try {
this.eventHandler.preReplaceChildEvent(node, child, newChild, property);
// N.B. even if event handler blows up, the AST is not
// corrupted since node has not been changed yet
} finally {
reenableEvents();
}
JAVA
// IMPORTANT: this method is called by readers during lazy init
synchronized (this.internalASTLock) {
// guard against concurrent access by a reader doing lazy init
if (this.disableEvents > 0) {
// System.out.println("[BOUNCE REP]");
return;
} else {
disableEvents();
}
}
try {
this.eventHandler.postReplaceChildEvent(node, child, newChild, property);
// N.B. even if event handler blows up, the AST is not
// corrupted since node has not been changed yet
} finally {
reenableEvents();
}
JAVA
// IMPORTANT: this method is called by readers during lazy init
synchronized (this.internalASTLock) {
// guard against concurrent access by a reader doing lazy init
if (this.disableEvents > 0) {
// System.out.println("[BOUNCE ADD]");
return;
} else {
disableEvents();
}
}
try {
this.eventHandler.preAddChildEvent(node, child, property);
// N.B. even if event handler blows up, the AST is not
// corrupted since node has already been changed
} finally {
reenableEvents();
}
JAVA
// IMPORTANT: this method is called by readers during lazy init
synchronized (this.internalASTLock) {
// guard against concurrent access by a reader doing lazy init
if (this.disableEvents > 0) {
// System.out.println("[BOUNCE ADD]");
return;
} else {
disableEvents();
}
}
try {
this.eventHandler.postAddChildEvent(node, child, property);
// N.B. even if event handler blows up, the AST is not
// corrupted since node has already been changed
} finally {
reenableEvents();
}
JAVA
// IMPORTANT: this method is called by readers during lazy init
synchronized (this.internalASTLock) {
// guard against concurrent access by a reader doing lazy init
if (this.disableEvents > 0) {
// System.out.println("[BOUNCE CHANGE]");
return;
} else {
disableEvents();
}
}
try {
this.eventHandler.preValueChangeEvent(node, property);
// N.B. even if event handler blows up, the AST is not
// corrupted since node has already been changed
} finally {
reenableEvents();
}
JAVA
// IMPORTANT: this method is called by readers during lazy init
synchronized (this.internalASTLock) {
// guard against concurrent access by a reader doing lazy init
if (this.disableEvents > 0) {
// System.out.println("[BOUNCE CHANGE]");
return;
} else {
disableEvents();
}
}
try {
this.eventHandler.postValueChangeEvent(node, property);
// N.B. even if event handler blows up, the AST is not
// corrupted since node has already been changed
} finally {
reenableEvents();
}
JAVA
synchronized (this.internalASTLock) {
// guard against concurrent access by a reader doing lazy init
if (this.disableEvents > 0) {
// System.out.println("[BOUNCE CLONE]");
return;
} else {
disableEvents();
}
}
try {
this.eventHandler.preCloneNodeEvent(node);
// N.B. even if event handler blows up, the AST is not
// corrupted since node has already been changed
} finally {
reenableEvents();
}
JAVA
synchronized (this.internalASTLock) {
// guard against concurrent access by a reader doing lazy init
if (this.disableEvents > 0) {
// System.out.println("[BOUNCE CLONE]");
return;
} else {
disableEvents();
}
}
try {
this.eventHandler.postCloneNodeEvent(node, clone);
// N.B. even if event handler blows up, the AST is not
// corrupted since node has already been changed
} finally {
reenableEvents();
}
JAVA
return this.eventHandler;
JAVA
if (this.eventHandler == null) {
throw new IllegalArgumentException();
}
this.eventHandler = eventHandler;
JAVA
return this.defaultNodeFlag;
JAVA
this.defaultNodeFlag = flag;
JAVA
this.originalModificationCount = count;
JAVA
if (this.apiLevel == PHPVersion.PHP4) {
throw new UnsupportedOperationException("Operation not supported in JLS2 AST");
}
JAVA
if (this.apiLevel != PHPVersion.PHP4) {
throw new UnsupportedOperationException("Operation not supported in JLS2 AST");
}
JAVA
if (nodeClass == null) {
throw new IllegalArgumentException();
}
try {
// invoke constructor with signature Foo(AST)
Constructor c = nodeClass.getDeclaredConstructor(AST_CLASS);
Object result = c.newInstance(this.THIS_AST);
return (ASTNode) result;
} catch (NoSuchMethodException e) {
throw new IllegalArgumentException();
} catch (InstantiationException e) {
throw new IllegalArgumentException();
} catch (IllegalAccessException e) {
throw new IllegalArgumentException();
} catch (InvocationTargetException e) {
throw new IllegalArgumentException();
}
JAVA
// nodeClassForType throws IllegalArgumentException if nodeType is bogus
Class nodeClass = ASTNode.nodeClassForType(nodeType);
return createInstance(nodeClass);
JAVA
return (this.bits & RESOLVED_BINDINGS) != 0;
JAVA
this.bits |= newValue;
JAVA
return lexer;
JAVA
return parser;
JAVA
return apiLevel;
JAVA
return useASPTags;
JAVA
if (reader == null) {
throw new IllegalArgumentException();
}
this.lexer.yyreset(reader);
this.lexer.resetCommentList();
this.parser.setScanner(this.lexer);
JAVA
ArrayAccess arrayAccess = new ArrayAccess(this);
return arrayAccess;
JAVA
ArrayAccess arrayAccess = new ArrayAccess(this);
arrayAccess.setName(variableName);
arrayAccess.setIndex(index);
arrayAccess.setArrayType(arrayType);
return arrayAccess;
JAVA
ArrayAccess arrayAccess = new ArrayAccess(this);
arrayAccess.setName(variableName);
arrayAccess.setIndex(index);
arrayAccess.setArrayType(ArrayAccess.VARIABLE_ARRAY);
return arrayAccess;
JAVA
ArrayCreation arrayCreation = new ArrayCreation(this);
return arrayCreation;
JAVA
ArrayCreation arrayCreation = new ArrayCreation(this);
arrayCreation.elements().addAll(elements);
return arrayCreation;
JAVA
ArrayElement arrayElement = new ArrayElement(this);
return arrayElement;
JAVA
ArrayElement arrayElement = new ArrayElement(this);
arrayElement.setKey(key);
arrayElement.setValue(value);
return arrayElement;
JAVA
Assignment assignment = new Assignment(this);
return assignment;
JAVA
Assignment assignment = new Assignment(this);
assignment.setLeftHandSide(leftHandSide);
assignment.setOperator(operator);
assignment.setRightHandSide(rightHandSide);
return assignment;
JAVA
ASTError astError = new ASTError(this);
return astError;
JAVA
BackTickExpression backTickExpression = new BackTickExpression(this);
return backTickExpression;
JAVA
BackTickExpression backTickExpression = new BackTickExpression(this);
backTickExpression.expressions().addAll(expressions);
return backTickExpression;
JAVA
Block block = new Block(this);
block.setIsCurly(true);
return block;
JAVA
Block block = new Block(this);
block.statements().addAll(statements);
block.setIsCurly(true);
return block;
JAVA
BreakStatement breakStatement = new BreakStatement(this);
return breakStatement;
JAVA
BreakStatement breakStatement = new BreakStatement(this);
breakStatement.setExpression(expression);
return breakStatement;
JAVA
CastExpression castExpression = new CastExpression(this);
return castExpression;
JAVA
CastExpression castExpression = new CastExpression(this);
castExpression.setExpression(expression);
castExpression.setCastingType(castType);
return castExpression;
JAVA
CatchClause catchClause = new CatchClause(this);
return catchClause;
JAVA
CatchClause catchClause = new CatchClause(this);
catchClause.setClassName(className);
catchClause.setVariable(variable);
catchClause.setBody(statement);
return catchClause;
JAVA
ConstantDeclaration classConstantDeclaration = new ConstantDeclaration(this);
return classConstantDeclaration;
JAVA
ConstantDeclaration classConstantDeclaration = new ConstantDeclaration(this);
classConstantDeclaration.initializers().addAll(initializers);
classConstantDeclaration.names().addAll(names);
return classConstantDeclaration;
JAVA
ClassDeclaration classDeclaration = new ClassDeclaration(this);
return classDeclaration;
JAVA
ClassDeclaration classDeclaration = new ClassDeclaration(this);
classDeclaration.setModifier(modifier);
classDeclaration.setName(newIdentifier(className));
if (superClass != null) {
classDeclaration.setSuperClass(newIdentifier(superClass));
} else {
classDeclaration.setSuperClass(null);
}
classDeclaration.interfaces().addAll(interfaces);
classDeclaration.setBody(body);
return classDeclaration;
JAVA
ClassInstanceCreation classInstanceCreation = new ClassInstanceCreation(this);
return classInstanceCreation;
JAVA
ClassInstanceCreation classInstanceCreation = new ClassInstanceCreation(this);
classInstanceCreation.setClassName(className);
classInstanceCreation.ctorParams().addAll(ctorParams);
return classInstanceCreation;
JAVA
ClassName className = new ClassName(this);
return className;
JAVA
ClassName className = new ClassName(this);
className.setClassName(name);
return className;
JAVA
CloneExpression cloneExpression = new CloneExpression(this);
return cloneExpression;
JAVA
CloneExpression cloneExpression = new CloneExpression(this);
cloneExpression.setExpression(expr);
return cloneExpression;
JAVA
Comment comment = new Comment(this);
return comment;
JAVA
Comment comment = new Comment(this);
comment.setCommentType(commentType);
return comment;
JAVA
ConditionalExpression conditionalExpression = new ConditionalExpression(this);
return conditionalExpression;
JAVA
ConditionalExpression conditionalExpression = new ConditionalExpression(this);
conditionalExpression.setCondition(condition);
conditionalExpression.setIfTrue(ifTrue);
conditionalExpression.setIfFalse(ifFalse);
return conditionalExpression;
JAVA
ContinueStatement continueStatement = new ContinueStatement(this);
return continueStatement;
JAVA
ContinueStatement continueStatement = new ContinueStatement(this);
continueStatement.setExpression(expr);
return continueStatement;
JAVA
DeclareStatement declareStatement = new DeclareStatement(this);
declareStatement.directiveNames().addAll(directiveNames);
declareStatement.directiveValues().addAll(directiveValues);
declareStatement.setBody(body);
return declareStatement;
JAVA
DoStatement doStatement = new DoStatement(this);
return doStatement;
JAVA
DoStatement doStatement = new DoStatement(this);
doStatement.setCondition(condition);
doStatement.setBody(body);
return doStatement;
JAVA
EchoStatement echoStatement = new EchoStatement(this);
return echoStatement;
JAVA
EchoStatement echoStatement = new EchoStatement(this);
echoStatement.expressions().add(expression);
return echoStatement;
JAVA
EmptyStatement emptyStatement = new EmptyStatement(this);
return emptyStatement;
JAVA
ExpressionStatement expressionStatement = new ExpressionStatement(this);
return expressionStatement;
JAVA
ExpressionStatement statement = newExpressionStatement();
statement.setExpression(expression);
return statement;
JAVA
FieldAccess fieldAccess = new FieldAccess(this);
return fieldAccess;
JAVA
FieldAccess fieldAccess = new FieldAccess(this);
fieldAccess.setDispatcher(dispatcher);
fieldAccess.setField(field);
return fieldAccess;
JAVA
FieldsDeclaration fieldsDeclaration = new FieldsDeclaration(this);
return fieldsDeclaration;
JAVA
FieldsDeclaration fieldsDeclaration = new FieldsDeclaration(this);
fieldsDeclaration.setModifier(modifier);
List<SingleFieldDeclaration> fields = fieldsDeclaration.fields();
fields.addAll(variablesAndDefaults);
return fieldsDeclaration;
JAVA
ForEachStatement forEachStatement = new ForEachStatement(this);
return forEachStatement;
JAVA
ForEachStatement forEachStatement = new ForEachStatement(this);
forEachStatement.setExpression(expression);
forEachStatement.setKey(key);
forEachStatement.setValue(value);
forEachStatement.setStatement(statement);
return forEachStatement;
JAVA
FormalParameter formalParameter = new FormalParameter(this);
return formalParameter;
JAVA
FormalParameter formalParameter = new FormalParameter(this);
formalParameter.setParameterType(type);
formalParameter.setParameterName(parameterName);
formalParameter.setDefaultValue(defaultValue);
if (apiLevel() == PHPVersion.PHP4) {
formalParameter.setIsMandatory(isMandatory);
}
return formalParameter;
JAVA
ForStatement forStatement = new ForStatement(this);
return forStatement;
JAVA
ForStatement forStatement = new ForStatement(this);
forStatement.initializers().addAll(initializers);
forStatement.updaters().addAll(updaters);
forStatement.conditions().addAll(conditions);
forStatement.setBody(body);
return forStatement;
JAVA
FunctionDeclaration functionDeclaration = new FunctionDeclaration(this);
return functionDeclaration;
JAVA
FunctionDeclaration functionDeclaration = new FunctionDeclaration(this);
functionDeclaration.setFunctionName(functionName);
functionDeclaration.formalParameters().addAll(formalParameters);
functionDeclaration.setBody(body);
functionDeclaration.setIsReference(isReference);
return functionDeclaration;
JAVA
FunctionInvocation functionInvocation = new FunctionInvocation(this);
return functionInvocation;
JAVA
FunctionInvocation functionInvocation = new FunctionInvocation(this);
functionInvocation.setFunctionName(functionName);
if (parameters != null) {
functionInvocation.parameters().addAll(parameters);
}
return functionInvocation;
JAVA
FunctionName functionName = new FunctionName(this);
return functionName;
JAVA
FunctionName functionName = new FunctionName(this);
functionName.setName(name);
return functionName;
JAVA
GlobalStatement globalStatement = new GlobalStatement(this);
return globalStatement;
JAVA
GlobalStatement globalStatement = new GlobalStatement(this);
globalStatement.variables().addAll(variables);
return globalStatement;
JAVA
Identifier identifier = new Identifier(this);
return identifier;
JAVA
if (identifier == null) {
throw new IllegalArgumentException();
}
Identifier result = new Identifier(this);
result.setName(identifier);
return result;
JAVA
IfStatement ifStatement = new IfStatement(this);
return ifStatement;
JAVA
IfStatement ifStatement = new IfStatement(this);
ifStatement.setCondition(condition);
ifStatement.setTrueStatement(trueStatement);
ifStatement.setFalseStatement(falseStatement);
return ifStatement;
JAVA
IgnoreError ignoreError = new IgnoreError(this);
return ignoreError;
JAVA
IgnoreError ignoreError = new IgnoreError(this);
ignoreError.setExpression(expression);
return ignoreError;
JAVA
Include include = new Include(this);
return include;
JAVA
Include include = new Include(this);
include.setExpression(expr);
include.setIncludetype(type);
return include;
JAVA
InfixExpression infixExpression = new InfixExpression(this);
return infixExpression;
JAVA
InfixExpression infixExpression = new InfixExpression(this);
infixExpression.setLeft(left);
infixExpression.setOperator(operator);
infixExpression.setRight(right);
return infixExpression;
JAVA
InLineHtml inLineHtml = new InLineHtml(this);
return inLineHtml;
JAVA
InstanceOfExpression instanceOfExpression = new InstanceOfExpression(this);
return instanceOfExpression;
JAVA
InstanceOfExpression instanceOfExpression = new InstanceOfExpression(this);
instanceOfExpression.setClassName(className);
instanceOfExpression.setExpression(expr);
return instanceOfExpression;
JAVA
InterfaceDeclaration interfaceDeclaration = new InterfaceDeclaration(this);
return interfaceDeclaration;
JAVA
InterfaceDeclaration interfaceDeclaration = new InterfaceDeclaration(this);
interfaceDeclaration.setName(interfaceName);
interfaceDeclaration.interfaces().addAll(interfaces);
interfaceDeclaration.setBody(body);
return interfaceDeclaration;
JAVA
ListVariable listVariable = new ListVariable(this);
return listVariable;
JAVA
ListVariable listVariable = new ListVariable(this);
listVariable.variables().addAll(variables);
return listVariable;
JAVA
MethodDeclaration methodDeclaration = new MethodDeclaration(this);
return methodDeclaration;
JAVA
MethodDeclaration methodDeclaration = new MethodDeclaration(this);
methodDeclaration.setModifier(modifier);
methodDeclaration.setFunction(function);
return methodDeclaration;
JAVA
MethodInvocation methodInvocation = new MethodInvocation(this);
return methodInvocation;
JAVA
MethodInvocation methodInvocation = new MethodInvocation(this);
methodInvocation.setDispatcher(dispatcher);
methodInvocation.setMethod(method);
return methodInvocation;
JAVA
ParenthesisExpression parenthesisExpression = new ParenthesisExpression(this);
return parenthesisExpression;
JAVA
ParenthesisExpression parenthesisExpression = new ParenthesisExpression(this);
parenthesisExpression.setExpression(expression);
return parenthesisExpression;
JAVA
PostfixExpression postfixExpression = new PostfixExpression(this);
return postfixExpression;
JAVA
PostfixExpression postfixExpression = new PostfixExpression(this);
postfixExpression.setVariable(variable);
postfixExpression.setOperator(operator);
return postfixExpression;
JAVA
PrefixExpression prefixExpression = new PrefixExpression(this);
return prefixExpression;
JAVA
PrefixExpression prefixExpression = new PrefixExpression(this);
prefixExpression.setVariable(variable);
prefixExpression.setOperator(operator);
return prefixExpression;
JAVA
Program program = new Program(this);
return program;
JAVA
Program program = new Program(this);
program.statements().addAll(statements);
program.comments().addAll(commentList);
return program;
JAVA
Quote quote = new Quote(this);
return quote;
JAVA
Quote quote = new Quote(this);
quote.expressions().addAll(expressions);
quote.setQuoteType(type);
return quote;
JAVA
Reference reference = new Reference(this);
return reference;
JAVA
Reference reference = new Reference(this);
reference.setExpression(expression);
return reference;
JAVA
ReflectionVariable reflectionVariable = new ReflectionVariable(this);
return reflectionVariable;
JAVA
ReflectionVariable reflectionVariable = new ReflectionVariable(this);
reflectionVariable.setName(expression);
return reflectionVariable;
JAVA
ReturnStatement returnStatement = new ReturnStatement(this);
return returnStatement;
JAVA
ReturnStatement returnStatement = new ReturnStatement(this);
returnStatement.setExpression(expression);
return returnStatement;
JAVA
Scalar scalar = new Scalar(this);
return scalar;
JAVA
Scalar scalar = newScalar(string);
scalar.setScalarType(scalarType);
return scalar;
JAVA
Scalar scalar = new Scalar(this);
scalar.setStringValue(string);
return scalar;
JAVA
SingleFieldDeclaration singleFieldDeclaration = new SingleFieldDeclaration(this);
return singleFieldDeclaration;
JAVA
SingleFieldDeclaration singleFieldDeclaration = new SingleFieldDeclaration(this);
singleFieldDeclaration.setName(name);
singleFieldDeclaration.setValue(value);
return singleFieldDeclaration;
JAVA
StaticConstantAccess staticConstantAccess = new StaticConstantAccess(this);
return staticConstantAccess;
JAVA
StaticConstantAccess staticConstantAccess = new StaticConstantAccess(this);
staticConstantAccess.setClassName(className);
staticConstantAccess.setConstant(constant);
return staticConstantAccess;
JAVA
StaticFieldAccess staticFieldAccess = new StaticFieldAccess(this);
return staticFieldAccess;
JAVA
StaticFieldAccess staticFieldAccess = new StaticFieldAccess(this);
staticFieldAccess.setClassName(className);
staticFieldAccess.setField(field);
return staticFieldAccess;
JAVA
StaticMethodInvocation staticMethodInvocation = new StaticMethodInvocation(this);
return staticMethodInvocation;
JAVA
StaticMethodInvocation staticMethodInvocation = new StaticMethodInvocation(this);
staticMethodInvocation.setClassName(className);
staticMethodInvocation.setMethod(method);
return staticMethodInvocation;
JAVA
StaticStatement staticStatement = new StaticStatement(this);
return staticStatement;
JAVA
StaticStatement staticStatement = new StaticStatement(this);
staticStatement.expressions().addAll(expressions);
return staticStatement;
JAVA
SwitchCase switchCase = new SwitchCase(this);
return switchCase;
JAVA
SwitchCase switchCase = new SwitchCase(this);
switchCase.setValue(value);
switchCase.actions().addAll(actions);
switchCase.setIsDefault(isDefault);
return switchCase;
JAVA
SwitchStatement switchStatement = new SwitchStatement(this);
return switchStatement;
JAVA
SwitchStatement switchStatement = new SwitchStatement(this);
switchStatement.setExpression(expression);
switchStatement.setBody(body);
return switchStatement;
JAVA
ThrowStatement throwStatement = new ThrowStatement(this);
return throwStatement;
JAVA
ThrowStatement throwStatement = new ThrowStatement(this);
throwStatement.setExpression(expression);
return throwStatement;
JAVA
TryStatement tryStatement = new TryStatement(this);
return tryStatement;
JAVA
TryStatement tryStatement = new TryStatement(this);
tryStatement.setBody(block);
tryStatement.catchClauses().addAll(catchClauses);
return tryStatement;
JAVA
UnaryOperation unaryOperation = new UnaryOperation(this);
return unaryOperation;
JAVA
UnaryOperation unaryOperation = new UnaryOperation(this);
unaryOperation.setExpression(expression);
unaryOperation.setOperator(operator);
return unaryOperation;
JAVA
Variable variable = new Variable(this);
return variable;
JAVA
Variable variable = newVariable();
variable.setIsDollared(isDollared);
variable.setName(name);
return variable;
JAVA
Variable variable = newVariable();
variable.setIsDollared(true);
variable.setName(newIdentifier(name));
return variable;
JAVA
WhileStatement whileStatement = new WhileStatement(this);
return whileStatement;
JAVA
WhileStatement whileStatement = new WhileStatement(this);
whileStatement.setCondition(condition);
whileStatement.setBody(body);
return whileStatement;
JAVA
NamespaceName namespaceName = new NamespaceName(this);
namespaceName.segments().addAll(segments);
namespaceName.setGlobal(isglobal);
namespaceName.setCurrent(iscurrent);
return namespaceName;
JAVA
NamespaceDeclaration namespaceDeclaration = new NamespaceDeclaration(this);
namespaceDeclaration.setName(name);
namespaceDeclaration.setBody(body);
return namespaceDeclaration;
JAVA
UseStatementPart usePart = new UseStatementPart(this);
usePart.setName(name);
usePart.setAlias(alias);
return usePart;
JAVA
UseStatement useStatement = new UseStatement(this);
useStatement.parts().addAll(parts);
return useStatement;
JAVA
GotoLabel gotoLabel = new GotoLabel(this);
gotoLabel.setName(label);
return gotoLabel;
JAVA
GotoStatement gotoStatement = new GotoStatement(this);
gotoStatement.setLabel(label);
return gotoStatement;
JAVA
LambdaFunctionDeclaration lfDeclaration = new LambdaFunctionDeclaration(this);
lfDeclaration.setBody(body);
lfDeclaration.setIsReference(isReference);
lfDeclaration.setStatic(isStatic);
lfDeclaration.formalParameters().addAll(formalParameters);
lfDeclaration.lexicalVariables().addAll(lexicalVars);
return lfDeclaration;
JAVA
ChainingInstanceCall lfDeclaration = new ChainingInstanceCall(this, arrayDereferenceList, chainingMethodOrProperty);
return lfDeclaration;
JAVA
DereferenceNode lfDeclaration = new DereferenceNode(this);
lfDeclaration.setName(indexName);
return lfDeclaration;
JAVA
FullyQualifiedTraitMethodReference lfDeclaration = new FullyQualifiedTraitMethodReference(this);
lfDeclaration.setClassName(className);
lfDeclaration.setFunctionName(functionName);
return lfDeclaration;
JAVA
PHPArrayDereferenceList lfDeclaration = new PHPArrayDereferenceList(this, dereferences);
return lfDeclaration;
JAVA
TraitAlias lfDeclaration = new TraitAlias(this);
lfDeclaration.setModifier(modifier);
lfDeclaration.setTraitMethod(traitMethod);
lfDeclaration.setFunctionName(functionName);
return lfDeclaration;
JAVA
TraitAliasStatement lfDeclaration = new TraitAliasStatement(this);
lfDeclaration.setAlias(alias);
return lfDeclaration;
JAVA
TraitDeclaration lfDeclaration = new TraitDeclaration(this);
return lfDeclaration;
JAVA
TraitDeclaration traitDeclaration = new TraitDeclaration(this);
traitDeclaration.setModifier(modifier);
traitDeclaration.setName(newIdentifier(className));
if (superClass != null) {
traitDeclaration.setSuperClass(newIdentifier(superClass));
} else {
traitDeclaration.setSuperClass(null);
}
traitDeclaration.interfaces().addAll(interfaces);
traitDeclaration.setBody(body);
return traitDeclaration;
JAVA
TraitPrecedence lfDeclaration = new TraitPrecedence(this);
lfDeclaration.setMethodReference(methodReference);
lfDeclaration.setTrList(trList);
return lfDeclaration;
JAVA
TraitPrecedenceStatement lfDeclaration = new TraitPrecedenceStatement(this);
lfDeclaration.setPrecedence(precedence);
return lfDeclaration;
JAVA
TraitUseStatement lfDeclaration = new TraitUseStatement(this);
lfDeclaration.setTraitList(traitList);
lfDeclaration.setTsList(tsList);
return lfDeclaration;
JAVA
super(start, end, ast);
JAVA
super(ast);
JAVA
0
JAVA
1
JAVA
2
JAVA
3
JAVA
4
JAVA
5
JAVA
6
JAVA
7
JAVA
8
JAVA
9
JAVA
10
JAVA
11
JAVA
12
JAVA
13
JAVA
14
JAVA
15
JAVA
16
JAVA
17
JAVA
18
JAVA
19
JAVA
20
JAVA
21
JAVA
22
JAVA
23
JAVA
24
JAVA
25
JAVA
26
JAVA
27
JAVA
28
JAVA
29
JAVA
30
JAVA
31
JAVA
32
JAVA
33
JAVA
34
JAVA
35
JAVA
36
JAVA
37
JAVA
38
JAVA
39
JAVA
40
JAVA
41
JAVA
42
JAVA
43
JAVA
44
JAVA
45
JAVA
46
JAVA
47
JAVA
48
JAVA
49
JAVA
50
JAVA
51
JAVA
52
JAVA
53
JAVA
54
JAVA
55
JAVA
56
JAVA
57
JAVA
58
JAVA
59
JAVA
60
JAVA
61
JAVA
62
JAVA
63
JAVA
64
JAVA
65
JAVA
66
JAVA
67
JAVA
68
JAVA
69
JAVA
70
JAVA
71
JAVA
72
JAVA
73
JAVA
74
JAVA
true
JAVA
false
JAVA
true
JAVA
false
JAVA
1
JAVA
2
JAVA
4
JAVA
8
JAVA
-1
JAVA
0
JAVA
0
JAVA
null
JAVA
null
JAVA
Collections.unmodifiableMap(new HashMap(1))
JAVA
null
JAVA
null
JAVA
if (ast == null) {
throw new IllegalArgumentException();
}
this.ast = ast;
setFlags(ast.getDefaultNodeFlag());
JAVA
this(ast);
this.start = start;
this.length = end - start;
JAVA
if (visitor == null) {
throw new IllegalArgumentException();
}
// begin with the generic pre-visit
visitor.preVisit(this);
// dynamic dispatch to internal method for type-specific visit/endVisit
accept0(visitor);
// end with the generic post-visit
visitor.postVisit(this);
JAVA
return this.location;
JAVA
if (property instanceof SimplePropertyDescriptor) {
SimplePropertyDescriptor p = (SimplePropertyDescriptor) property;
if (p.getValueType() == Integer.class) {
int result = internalGetSetIntProperty(p, true, 0);
return new Integer(result);
} else if (p.getValueType() == Boolean.class) {
boolean result = internalGetSetBooleanProperty(p, true, false);
return Boolean.valueOf(result);
} else {
return internalGetSetObjectProperty(p, true, null);
}
}
if (property instanceof ChildPropertyDescriptor) {
return internalGetSetChildProperty((ChildPropertyDescriptor) property, true, null);
}
if (property instanceof ChildListPropertyDescriptor) {
return internalGetChildListProperty((ChildListPropertyDescriptor) property);
}
throw new IllegalArgumentException();
JAVA
if (property instanceof SimplePropertyDescriptor) {
SimplePropertyDescriptor p = (SimplePropertyDescriptor) property;
if (p.getValueType() == int.class) {
int arg = ((Integer) value).intValue();
internalGetSetIntProperty(p, false, arg);
return;
} else if (p.getValueType() == boolean.class) {
boolean arg = ((Boolean) value).booleanValue();
internalGetSetBooleanProperty(p, false, arg);
return;
} else {
if (value == null && p.isMandatory()) {
throw new IllegalArgumentException();
}
internalGetSetObjectProperty(p, false, value);
return;
}
}
if (property instanceof ChildPropertyDescriptor) {
ChildPropertyDescriptor p = (ChildPropertyDescriptor) property;
ASTNode child = (ASTNode) value;
if (child == null && p.isMandatory()) {
throw new IllegalArgumentException();
}
internalGetSetChildProperty(p, false, child);
return;
}
if (property instanceof ChildListPropertyDescriptor) {
throw new IllegalArgumentException("Cannot set the list of child list property");
}
JAVA
return internalStructuralPropertiesForType(this.ast.apiLevel);
JAVA
return this.ast;
JAVA
return parent;
JAVA
this.parent = parent;
this.location = location;
JAVA
return length;
JAVA
return start;
JAVA
return start + length;
JAVA
switch(nodeType) {
case ARRAY_ACCESS:
return ArrayAccess.class;
case ARRAY_CREATION:
return ArrayCreation.class;
case ARRAY_ELEMENT:
return ArrayElement.class;
case ASSIGNMENT:
return Assignment.class;
case AST_ERROR:
return ASTError.class;
case BACK_TICK_EXPRESSION:
return BackTickExpression.class;
case BLOCK:
return Block.class;
case BREAK_STATEMENT:
return BreakStatement.class;
case CAST_EXPRESSION:
return CastExpression.class;
case CATCH_CLAUSE:
return CatchClause.class;
case STATIC_CONSTANT_ACCESS:
return StaticConstantAccess.class;
case CONSTANT_DECLARATION:
return ConstantDeclaration.class;
case CLASS_DECLARATION:
return ClassDeclaration.class;
case CLASS_INSTANCE_CREATION:
return ClassInstanceCreation.class;
case CLASS_NAME:
return ClassName.class;
case CLONE_EXPRESSION:
return CloneExpression.class;
case COMMENT:
return Comment.class;
case CONDITIONAL_EXPRESSION:
return ConditionalExpression.class;
case CONTINUE_STATEMENT:
return ContinueStatement.class;
case DECLARE_STATEMENT:
return DeclareStatement.class;
case DO_STATEMENT:
return DoStatement.class;
case ECHO_STATEMENT:
return EchoStatement.class;
case EMPTY_STATEMENT:
return EmptyStatement.class;
case EXPRESSION_STATEMENT:
return ExpressionStatement.class;
case FIELD_ACCESS:
return FieldAccess.class;
case FIELD_DECLARATION:
return FieldsDeclaration.class;
case FOR_EACH_STATEMENT:
return ForEachStatement.class;
case FORMAL_PARAMETER:
return FormalParameter.class;
case FOR_STATEMENT:
return ForStatement.class;
case FUNCTION_DECLARATION:
return FunctionDeclaration.class;
case FUNCTION_INVOCATION:
return FunctionInvocation.class;
case FUNCTION_NAME:
return FunctionName.class;
case GLOBAL_STATEMENT:
return GlobalStatement.class;
case GOTO_LABEL:
return GotoLabel.class;
case GOTO_STATEMENT:
return GotoStatement.class;
case IDENTIFIER:
return Identifier.class;
case IF_STATEMENT:
return IfStatement.class;
case IGNORE_ERROR:
return IgnoreError.class;
case INCLUDE:
return Include.class;
case INFIX_EXPRESSION:
return InfixExpression.class;
case IN_LINE_HTML:
return InLineHtml.class;
case INSTANCE_OF_EXPRESSION:
return InstanceOfExpression.class;
case INTERFACE_DECLARATION:
return InterfaceDeclaration.class;
case LAMBDA_FUNCTION_DECLARATION:
return LambdaFunctionDeclaration.class;
case LIST_VARIABLE:
return ListVariable.class;
case METHOD_DECLARATION:
return MethodDeclaration.class;
case METHOD_INVOCATION:
return MethodInvocation.class;
case NAMESPACE:
return NamespaceDeclaration.class;
case NAMESPACE_NAME:
return NamespaceName.class;
case POSTFIX_EXPRESSION:
return PostfixExpression.class;
case PREFIX_EXPRESSION:
return PrefixExpression.class;
case PROGRAM:
return Program.class;
case QUOTE:
return Quote.class;
case REFERENCE:
return Reference.class;
case REFLECTION_VARIABLE:
return ReflectionVariable.class;
case RETURN_STATEMENT:
return ReturnStatement.class;
case SCALAR:
return Scalar.class;
case STATIC_FIELD_ACCESS:
return StaticFieldAccess.class;
case STATIC_METHOD_INVOCATION:
return StaticMethodInvocation.class;
case STATIC_STATEMENT:
return StaticStatement.class;
case SWITCH_CASE:
return SwitchCase.class;
case SWITCH_STATEMENT:
return SwitchStatement.class;
case THROW_STATEMENT:
return ThrowStatement.class;
case TRY_STATEMENT:
return TryStatement.class;
case UNARY_OPERATION:
return UnaryOperation.class;
case USE_STATEMENT:
return UseStatement.class;
case USE_STATEMENT_PART:
return UseStatementPart.class;
case VARIABLE:
return Variable.class;
case WHILE_STATEMENT:
return WhileStatement.class;
case PARENTHESIS_EXPRESSION:
return ParenthesisExpression.class;
}
throw new IllegalArgumentException();
JAVA
final StringBuffer buffer = new StringBuffer();
//$NON-NLS-1$
toString(buffer, "");
return buffer.toString();
JAVA
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
buffer.append(" start='").append(start).append("' length='").append(length).append("'");
JAVA
String escapedString = input;
//$NON-NLS-1$ //$NON-NLS-2$
escapedString = escapedString.replaceAll("&", "&");
//$NON-NLS-1$ //$NON-NLS-2$
escapedString = escapedString.replaceAll(">", ">");
//$NON-NLS-1$ //$NON-NLS-2$
escapedString = escapedString.replaceAll("<", "<");
//$NON-NLS-1$ //$NON-NLS-2$
escapedString = escapedString.replaceAll("'", "'");
return escapedString;
JAVA
ASTNode node = this;
while (node != null) {
if (node.getType() == ASTNode.PROGRAM) {
return (Program) node;
}
node = node.getParent();
}
return null;
JAVA
ASTNode node = this;
do {
switch(node.getType()) {
case ASTNode.FUNCTION_DECLARATION:
return node;
case ASTNode.FIELD_DECLARATION:
return null;
case ASTNode.PROGRAM:
return node;
}
node = node.getParent();
} while (node != null);
return null;
JAVA
ASTNode candidate = this;
while (true) {
ASTNode p = candidate.getParent();
if (p == null) {
// candidate has no parent - that's the guy
return candidate;
}
candidate = p;
}
JAVA
if (startPosition >= 0 && length < 0) {
throw new IllegalArgumentException();
}
if (startPosition < 0 && length != 0) {
throw new IllegalArgumentException();
}
this.start = startPosition;
this.length = length;
JAVA
StructuralPropertyDescriptor p = getLocationInParent();
if (p == null) {
// node is unparented
return;
}
if (p.isChildProperty()) {
getParent().setStructuralProperty(this.location, null);
return;
}
if (p.isChildListProperty()) {
List l = (List) getParent().getStructuralProperty(this.location);
l.remove(this);
}
JAVA
if ((this.flags & PROTECT) != 0) {
//$NON-NLS-1$
throw new IllegalArgumentException("AST node cannot be modified");
}
if (newChild != null) {
checkNewChild(this, newChild, property.cycleRisk, null);
}
// delink old child from parent
if (oldChild != null) {
if ((oldChild.flags & PROTECT) != 0) {
// old child node is protected => cannot be unparented
throw new IllegalArgumentException("AST node cannot be modified");
}
if (newChild != null) {
this.ast.preReplaceChildEvent(this, oldChild, newChild, property);
} else {
this.ast.preRemoveChildEvent(this, oldChild, property);
}
oldChild.setParent(null, null);
} else {
if (newChild != null) {
this.ast.preAddChildEvent(this, newChild, property);
}
}
// link new child to parent
if (newChild != null) {
newChild.setParent(this, property);
// cannot notify postAddChildEvent until parent is linked to child
// too
}
JAVA
// link new child to parent
if (newChild != null) {
if (oldChild != null) {
this.ast.postReplaceChildEvent(this, oldChild, newChild, property);
} else {
this.ast.postAddChildEvent(this, newChild, property);
}
} else {
this.ast.postRemoveChildEvent(this, oldChild, property);
}
JAVA
if ((this.flags & PROTECT) != 0) {
//$NON-NLS-1$
throw new IllegalArgumentException("AST node cannot be modified");
}
this.ast.preValueChangeEvent(this, property);
this.ast.modifying();
JAVA
this.ast.postValueChangeEvent(this, property);
JAVA
if ((this.flags & PROTECT) != 0) {
//$NON-NLS-1$
throw new IllegalArgumentException("AST node cannot be modified");
}
this.ast.modifying();
JAVA
// IMPORTANT: this method is called by readers
// ASTNode.this is locked at this point
this.ast.disableEvents();
// will turn events back on in postLasyInit
JAVA
// IMPORTANT: this method is called by readers
// ASTNode.this is locked at this point
// newChild is brand new (so no chance of concurrent access)
newChild.setParent(this, property);
// turn events back on (they were turned off in corresponding
// preLazyInit)
this.ast.reenableEvents();
JAVA
if (propertyName == null) {
throw new IllegalArgumentException();
}
if (this.property1 == null) {
// node has no properties at all
return null;
}
if (this.property1 instanceof String) {
// node has only a single property
if (propertyName.equals(this.property1)) {
return this.property2;
} else {
return null;
}
}
// otherwise node has table of properties
Map m = (Map) this.property1;
return m.get(propertyName);
JAVA
if (propertyName == null) {
throw new IllegalArgumentException();
}
if (this.property1 == null) {
// node has no properties at all
if (data == null) {
// we already know this
return;
}
// node gets its fist property
this.property1 = propertyName;
this.property2 = data;
return;
}
if (this.property1 instanceof String) {
// node has only a single property
if (propertyName.equals(this.property1)) {
// we're in luck
this.property2 = data;
if (data == null) {
// just deleted last property
this.property1 = null;
this.property2 = null;
}
return;
}
if (data == null) {
// we already know this
return;
}
// node already has one property - getting its second
// convert to more flexible representation
HashMap m = new HashMap(2);
m.put(this.property1, this.property2);
m.put(propertyName, data);
this.property1 = m;
this.property2 = null;
return;
}
// node has two or more properties
HashMap m = (HashMap) this.property1;
if (data == null) {
m.remove(propertyName);
// check for just one property left
if (m.size() == 1) {
// convert to more efficient representation
Map.Entry[] entries = (Map.Entry[]) m.entrySet().toArray(new Map.Entry[1]);
this.property1 = entries[0].getKey();
this.property2 = entries[0].getValue();
}
return;
} else {
m.put(propertyName, data);
// still has two or more properties
return;
}
JAVA
if (this.property1 == null) {
// node has no properties at all
return UNMODIFIABLE_EMPTY_MAP;
}
if (this.property1 instanceof String) {
// node has a single property
return Collections.singletonMap(this.property1, this.property2);
}
// node has two or more properties
if (this.property2 == null) {
this.property2 = Collections.unmodifiableMap((Map) this.property1);
}
// property2 is unmodifiable wrapper for map in property1
return (Map) this.property2;
JAVA
return this.flags & 0xFFFF;
JAVA
this.ast.modifying();
this.flags |= flags;
JAVA
if (node == null) {
return null;
}
if (target == null) {
throw new IllegalArgumentException();
}
if (target.apiLevel() != node.getAST().apiLevel()) {
throw new UnsupportedOperationException();
}
T newNode = (T) node.clone(target);
return newNode;
JAVA
List result = new ArrayList(nodes.size());
for (Iterator it = nodes.iterator(); it.hasNext(); ) {
ASTNode oldNode = (ASTNode) it.next();
ASTNode newNode = oldNode.clone(target);
result.add(newNode);
}
return result;
JAVA
this.ast.preCloneNodeEvent(this);
ASTNode c = this.clone0(target);
this.ast.postCloneNodeEvent(this, c);
return c;
JAVA
if (newChild.ast != node.ast) {
// new child is from a different AST
throw new IllegalArgumentException();
}
if (newChild.getParent() != null) {
// new child currently has a different parent
throw new IllegalArgumentException();
}
if (cycleCheck && newChild == node.getProgramRoot()) {
// inserting new child would create a cycle
throw new IllegalArgumentException();
}
Class childClass = newChild.getClass();
if (nodeType != null && !nodeType.isAssignableFrom(childClass)) {
// new child is not of the right type
throw new ClassCastException();
}
if ((newChild.flags & PROTECT) != 0) {
//$NON-NLS-1$
throw new IllegalArgumentException("AST node cannot be modified");
}
JAVA
//$NON-NLS-1$
throw new RuntimeException("Node does not have this property");
JAVA
//$NON-NLS-1$
throw new RuntimeException("Node does not have this property");
JAVA
//$NON-NLS-1$
throw new RuntimeException("Node does not have this property");
JAVA
//$NON-NLS-1$
throw new RuntimeException("Node does not have this property");
JAVA
//$NON-NLS-1$
throw new RuntimeException("Node does not have this property");
JAVA
new ArrayList<T>(0)
JAVA
null
JAVA
super();
this.propertyDescriptor = property;
JAVA
return this.store.size();
JAVA
return this.store.get(index);
JAVA
if (element == null) {
throw new IllegalArgumentException();
}
if ((ASTNode.this.flags & PROTECT) != 0) {
// this node is protected => cannot gain or lose children
throw new IllegalArgumentException("AST node cannot be modified");
}
// delink old child from parent, and link new child to parent
ASTNode newChild = element;
ASTNode oldChild = this.store.get(index);
if (oldChild == newChild) {
return (T) oldChild;
}
if ((oldChild.flags & PROTECT) != 0) {
// old child is protected => cannot be unparented
throw new IllegalArgumentException("AST node cannot be modified");
}
ASTNode.checkNewChild(ASTNode.this, newChild, this.propertyDescriptor.cycleRisk, this.propertyDescriptor.elementType);
ASTNode.this.ast.preReplaceChildEvent(ASTNode.this, oldChild, newChild, this.propertyDescriptor);
T result = this.store.set(index, (T) newChild);
// n.b. setParent will call ast.modifying()
oldChild.setParent(null, null);
newChild.setParent(ASTNode.this, this.propertyDescriptor);
ASTNode.this.ast.postReplaceChildEvent(ASTNode.this, oldChild, newChild, this.propertyDescriptor);
return result;
JAVA
if (element == null) {
throw new IllegalArgumentException();
}
if ((ASTNode.this.flags & PROTECT) != 0) {
// this node is protected => cannot gain or lose children
throw new IllegalArgumentException("AST node cannot be modified");
}
// link new child to parent
ASTNode newChild = element;
ASTNode.checkNewChild(ASTNode.this, newChild, this.propertyDescriptor.cycleRisk, this.propertyDescriptor.elementType);
ASTNode.this.ast.preAddChildEvent(ASTNode.this, newChild, this.propertyDescriptor);
this.store.add(index, element);
updateCursors(index, +1);
// n.b. setParent will call ast.modifying()
newChild.setParent(ASTNode.this, this.propertyDescriptor);
ASTNode.this.ast.postAddChildEvent(ASTNode.this, newChild, this.propertyDescriptor);
JAVA
if ((ASTNode.this.flags & PROTECT) != 0) {
// this node is protected => cannot gain or lose children
throw new IllegalArgumentException("AST node cannot be modified");
}
// delink old child from parent
ASTNode oldChild = this.store.get(index);
if ((oldChild.flags & PROTECT) != 0) {
// old child is protected => cannot be unparented
throw new IllegalArgumentException("AST node cannot be modified");
}
ASTNode.this.ast.preRemoveChildEvent(ASTNode.this, oldChild, this.propertyDescriptor);
// n.b. setParent will call ast.modifying()
oldChild.setParent(null, null);
T result = this.store.remove(index);
updateCursors(index, -1);
ASTNode.this.ast.postRemoveChildEvent(ASTNode.this, oldChild, this.propertyDescriptor);
return result;
JAVA
synchronized (this) {
// serialize cursor management on this NodeList
if (this.cursors == null) {
// convert null to empty list
this.cursors = new ArrayList(1);
}
Cursor result = new Cursor();
this.cursors.add(result);
return result;
}
JAVA
synchronized (this) {
// serialize cursor management on this NodeList
this.cursors.remove(cursor);
if (this.cursors.isEmpty()) {
// important: convert empty list back to null
// otherwise the node will hang on to needless junk
this.cursors = null;
}
}
JAVA
if (this.cursors == null) {
// there are no cursors to worry about
return;
}
for (Iterator it = this.cursors.iterator(); it.hasNext(); ) {
Cursor c = (Cursor) it.next();
c.update(index, delta);
}
JAVA
0
JAVA
return this.position < NodeList.this.store.size();
JAVA
T result = NodeList.this.store.get(this.position);
this.position++;
return result;
JAVA
throw new UnsupportedOperationException();
JAVA
if (this.position > index) {
// the cursor has passed the added or removed element
this.position += delta;
}
JAVA
new ASTNode.NodeList<ArrayElement>(ELEMENTS_PROPERTY)
JAVA
new ChildListPropertyDescriptor(ArrayCreation.class, "elements", ArrayElement.class, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(LambdaFunctionDeclaration.class, "hasArrayKey", Boolean.class, //$NON-NLS-1$
OPTIONAL)
JAVA
super(ast);
JAVA
super(start, end, ast);
if (elements == null) {
throw new IllegalArgumentException();
}
for (ArrayElement arrayElement : elements) {
this.elements.add(arrayElement);
}
setHasArrayKey(hasArrayKey);
JAVA
this(start, end, ast, elements == null ? null : (ArrayElement[]) elements.toArray(new ArrayElement[elements.size()]), true);
JAVA
this(start, end, ast, elements == null ? null : (ArrayElement[]) elements.toArray(new ArrayElement[elements.size()]), hasArrayKey);
JAVA
return hasArrayKey;
JAVA
preValueChange(HAS_ARRAY_KEY);
this.hasArrayKey = hasArrayKey;
postValueChange(HAS_ARRAY_KEY);
JAVA
if (property == HAS_ARRAY_KEY) {
if (get) {
return isHasArrayKey();
} else {
setHasArrayKey(value);
return false;
}
}
// allow default implementation to flag the error
return super.internalGetSetBooleanProperty(property, get, value);
JAVA
for (ASTNode node : this.elements) {
node.accept(visitor);
}
JAVA
accept(visitor);
for (ASTNode node : this.elements) {
node.traverseTopDown(visitor);
}
JAVA
for (ASTNode node : this.elements) {
node.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ArrayCreation");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
for (ASTNode node : this.elements) {
node.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</ArrayCreation>");
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
return ASTNode.ARRAY_CREATION;
JAVA
return elements.toArray(new ArrayElement[elements.size()]);
JAVA
return this.elements;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final List elements = ASTNode.copySubtrees(target, elements());
final ArrayCreation result = new ArrayCreation(this.getStart(), this.getEnd(), target, elements);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == ELEMENTS_PROPERTY) {
return elements();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
super(nodeClass, propertyId);
if (elementType == null) {
throw new IllegalArgumentException();
}
this.elementType = elementType;
this.cycleRisk = cycleRisk;
JAVA
return this.elementType;
JAVA
return this.cycleRisk;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ArrayElement.class, "key", Expression.class, OPTIONAL, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ArrayElement.class, "value", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
super(ast);
JAVA
super(start, end, ast);
if (value == null) {
throw new IllegalArgumentException();
}
setValue(value);
if (key != null) {
setKey(key);
}
JAVA
this(start, end, ast, null, value);
JAVA
if (key != null) {
key.accept(visitor);
}
value.accept(visitor);
JAVA
accept(visitor);
if (key != null) {
key.traverseTopDown(visitor);
}
value.traverseTopDown(visitor);
JAVA
if (key != null) {
key.traverseBottomUp(visitor);
}
value.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ArrayElement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Key>\n");
if (key != null) {
key.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</Key>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Value>\n");
value.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</Value>\n");
//$NON-NLS-1$
buffer.append(tab).append("</ArrayElement>");
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
return ASTNode.ARRAY_ELEMENT;
JAVA
return key;
JAVA
ASTNode oldChild = this.key;
preReplaceChild(oldChild, expression, KEY_PROPERTY);
this.key = expression;
postReplaceChild(oldChild, expression, KEY_PROPERTY);
JAVA
return this.value;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.value;
preReplaceChild(oldChild, expression, VALUE_PROPERTY);
this.value = expression;
postReplaceChild(oldChild, expression, VALUE_PROPERTY);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression key = ASTNode.copySubtree(target, getKey());
final Expression value = ASTNode.copySubtree(target, getValue());
final ArrayElement result = new ArrayElement(this.getStart(), this.getEnd(), target, key, value);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == KEY_PROPERTY) {
if (get) {
return getKey();
} else {
setKey((Expression) child);
return null;
}
}
if (property == VALUE_PROPERTY) {
if (get) {
return getValue();
} else {
setValue((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
0
JAVA
1
JAVA
2
JAVA
3
JAVA
4
JAVA
5
JAVA
6
JAVA
7
JAVA
8
JAVA
9
JAVA
10
JAVA
11
JAVA
new ChildPropertyDescriptor(Assignment.class, "variable", VariableBase.class, MANDATORY, CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(Assignment.class, "operator", Integer.class, MANDATORY)
JAVA
new ChildPropertyDescriptor(Assignment.class, "value", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (leftHandSide == null || rightHandSide == null || getOperator(operator) == null) {
throw new IllegalArgumentException();
}
setLeftHandSide(leftHandSide);
setOperator(operator);
setRightHandSide(rightHandSide);
JAVA
super(ast);
JAVA
switch(operator) {
case OP_EQUAL:
//$NON-NLS-1$
return "=";
case OP_PLUS_EQUAL:
//$NON-NLS-1$
return "+=";
case OP_MINUS_EQUAL:
//$NON-NLS-1$
return "-=";
case OP_MUL_EQUAL:
//$NON-NLS-1$
return "*=";
case OP_DIV_EQUAL:
//$NON-NLS-1$
return "/=";
case OP_MOD_EQUAL:
//$NON-NLS-1$
return "%=";
case OP_CONCAT_EQUAL:
//$NON-NLS-1$
return ".=";
case OP_AND_EQUAL:
//$NON-NLS-1$
return "&=";
case OP_OR_EQUAL:
//$NON-NLS-1$
return "|=";
case OP_XOR_EQUAL:
//$NON-NLS-1$
return "^=";
case OP_SL_EQUAL:
//$NON-NLS-1$
return "<<=";
case OP_SR_EQUAL:
//$NON-NLS-1$
return ">>=";
default:
throw new IllegalArgumentException();
}
JAVA
leftHandSide.accept(visitor);
rightHandSide.accept(visitor);
JAVA
accept(visitor);
leftHandSide.traverseTopDown(visitor);
rightHandSide.traverseTopDown(visitor);
JAVA
leftHandSide.traverseBottomUp(visitor);
rightHandSide.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<Assignment");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" operator='").append(getXmlStringValue(getOperator(operator))).append("'>\n");
leftHandSide.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("<Value>\n");
rightHandSide.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</Value>\n");
//$NON-NLS-1$
buffer.append(tab).append("</Assignment>");
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
return ASTNode.ASSIGNMENT;
JAVA
return rightHandSide;
JAVA
return leftHandSide;
JAVA
return this.operator;
JAVA
return getOperator(this.getOperator());
JAVA
return getOperator(op);
JAVA
if (getOperator(assignmentOperator) == null) {
//$NON-NLS-1$
throw new IllegalArgumentException("Invalid operator");
}
preValueChange(OPERATOR_PROPERTY);
this.operator = assignmentOperator;
postValueChange(OPERATOR_PROPERTY);
JAVA
return this.leftHandSide;
JAVA
if (leftHandSide == null) {
throw new IllegalArgumentException();
}
// an Assignment may occur inside a Expression - must check cycles
ASTNode oldChild = this.leftHandSide;
preReplaceChild(oldChild, leftHandSide, LEFT_HAND_SIDE_PROPERTY);
this.leftHandSide = leftHandSide;
postReplaceChild(oldChild, leftHandSide, LEFT_HAND_SIDE_PROPERTY);
JAVA
return this.rightHandSide;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
// an Assignment may occur inside a Expression - must check cycles
ASTNode oldChild = this.rightHandSide;
preReplaceChild(oldChild, expression, RIGHT_HAND_SIDE_PROPERTY);
this.rightHandSide = expression;
postReplaceChild(oldChild, expression, RIGHT_HAND_SIDE_PROPERTY);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final VariableBase left = ASTNode.copySubtree(target, getLeftHandSide());
final Expression right = ASTNode.copySubtree(target, getRightHandSide());
final Assignment result = new Assignment(this.getStart(), this.getEnd(), target, left, this.getOperator(), right);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == OPERATOR_PROPERTY) {
if (get) {
return getOperator();
} else {
setOperator(value);
return 0;
}
}
// allow default implementation to flag the error
return super.internalGetSetIntProperty(property, get, value);
JAVA
if (property == LEFT_HAND_SIDE_PROPERTY) {
if (get) {
return getLeftHandSide();
} else {
setLeftHandSide((VariableBase) child);
return null;
}
}
if (property == RIGHT_HAND_SIDE_PROPERTY) {
if (get) {
return getRightHandSide();
} else {
setRightHandSide((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// default implementation: do nothing
JAVA
// do nothing
// System.out.println("DEL1 " + property);
JAVA
// do nothing
// System.out.println("DEL2 " + property);
JAVA
// do nothing
// System.out.println("REP1 " + property);
JAVA
// do nothing
// System.out.println("REP2 " + property);
JAVA
// do nothing
// System.out.println("ADD1 " + property);
JAVA
// do nothing
// System.out.println("ADD2 " + property);
JAVA
// do nothing
// System.out.println("MOD1 " + property);
JAVA
// do nothing
// System.out.println("MOD2 " + property);
JAVA
// do nothing
// System.out.println("CLONE1");
JAVA
// do nothing
// System.out.println("CLONE2");
JAVA
super(start, end, ast);
JAVA
super(ast);
JAVA
JAVA
JAVA
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<AstError");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append("/>");
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
return ASTNode.AST_ERROR;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final ASTError result = new ASTError(this.getStart(), this.getEnd(), target);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<Expression>(EXPRESSIONS_PROPERTY)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(BackTickExpression.class, "expressions", Expression.class, CYCLE_RISK)
JAVA
this(start, end, ast, expressions == null ? null : (Expression[]) expressions.toArray(new Expression[expressions.size()]));
JAVA
super(ast);
JAVA
for (ASTNode node : this.expressions) {
node.accept(visitor);
}
JAVA
accept(visitor);
for (ASTNode node : this.expressions) {
node.traverseTopDown(visitor);
}
JAVA
for (ASTNode node : this.expressions) {
node.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<BackTickExpression");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
for (ASTNode node : this.expressions) {
node.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</BackTickExpression>");
JAVA
return ASTNode.BACK_TICK_EXPRESSION;
JAVA
return this.expressions.toArray(new Expression[this.expressions.size()]);
JAVA
return this.expressions;
JAVA
if (property == EXPRESSIONS_PROPERTY) {
return expressions();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final List expressions = ASTNode.copySubtrees(target, expressions());
final BackTickExpression bkExpression = new BackTickExpression(this.getStart(), this.getEnd(), target, expressions);
return bkExpression;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<Statement>(STATEMENTS_PROPERTY)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(Block.class, "statements", Statement.class, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new SimplePropertyDescriptor(Block.class, "isCurly", Boolean.class, OPTIONAL)
JAVA
super(start, end, ast);
if (statements == null) {
throw new IllegalArgumentException();
}
setIsCurly(isCurly);
// set the child nodes' parent
for (int i = 0; i < statements.length; i++) {
this.statements.add(statements[i]);
}
JAVA
this(start, end, ast, statements == null ? null : (Statement[]) statements.toArray(new Statement[statements.size()]), isCurly);
JAVA
this(start, end, ast, statements, true);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
for (ASTNode statement : statements) {
statement.accept(visitor);
}
JAVA
accept(visitor);
for (ASTNode statement : statements) {
statement.traverseTopDown(visitor);
}
JAVA
for (ASTNode statement : statements) {
statement.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<Block");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" isCurly='").append(isCurly).append("'>\n");
for (ASTNode statement : statements) {
statement.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</Block>");
JAVA
return ASTNode.BLOCK;
JAVA
return isCurly;
JAVA
preValueChange(IS_CURLY_PROPERTY);
this.isCurly = isCurly;
postValueChange(IS_CURLY_PROPERTY);
JAVA
return statements.toArray(new Statement[statements.size()]);
JAVA
return this.statements;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final List statements = ASTNode.copySubtrees(target, statements());
final Block result = new Block(this.getStart(), this.getEnd(), target, statements, this.isCurly());
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == STATEMENTS_PROPERTY) {
return statements();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
if (property == IS_CURLY_PROPERTY) {
if (get) {
return isCurly();
} else {
setIsCurly(value);
return false;
}
}
// allow default implementation to flag the error
return super.internalGetSetBooleanProperty(property, get, value);
JAVA
super(start, end, ast);
JAVA
super(ast);
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(BreakStatement.class, "expression", Expression.class, OPTIONAL, CYCLE_RISK)
JAVA
this(start, end, ast, null);
JAVA
super(ast);
JAVA
super(start, end, ast);
if (expr != null) {
setExpression(expr);
}
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
if (expression != null) {
expression.accept(visitor);
}
JAVA
accept(visitor);
if (expression != null) {
expression.traverseTopDown(visitor);
}
JAVA
if (expression != null) {
expression.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<BreakStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
if (expression != null) {
expression.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</BreakStatement>");
JAVA
return ASTNode.BREAK_STATEMENT;
JAVA
return expression;
JAVA
return expression;
JAVA
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getExpression());
final BreakStatement result = new BreakStatement(this.getStart(), this.getEnd(), target, expr);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
0
JAVA
1
JAVA
2
JAVA
3
JAVA
4
JAVA
5
JAVA
6
JAVA
new ChildPropertyDescriptor(CastExpression.class, "expression", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(CastExpression.class, "castingType", Integer.class, MANDATORY)
JAVA
super(start, end, ast);
if (expr == null) {
throw new IllegalArgumentException();
}
setExpression(expr);
setCastingType(castType);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
switch(type) {
case TYPE_INT:
//$NON-NLS-1$
return "int";
case TYPE_REAL:
//$NON-NLS-1$
return "real";
case TYPE_STRING:
return //$NON-NLS-1$
"string";
case TYPE_ARRAY:
return //$NON-NLS-1$
"array";
case TYPE_OBJECT:
return //$NON-NLS-1$
"object";
case TYPE_BOOL:
//$NON-NLS-1$
return "bool";
case TYPE_UNSET:
return //$NON-NLS-1$
"unset";
default:
throw new IllegalArgumentException();
}
JAVA
expression.accept(visitor);
JAVA
accept(visitor);
expression.traverseTopDown(visitor);
JAVA
expression.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<CastExpression");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" castType='").append(getCastType(castingType)).append("'>\n");
expression.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</CastExpression>");
JAVA
return ASTNode.CAST_EXPRESSION;
JAVA
return castingType;
JAVA
return expression;
JAVA
return this.castingType;
JAVA
if (getCastType(castingType) == null) {
//$NON-NLS-1$
throw new IllegalArgumentException("Invalid type");
}
preValueChange(CASTING_TYPE_PROPERTY);
this.castingType = castingType;
postValueChange(CASTING_TYPE_PROPERTY);
JAVA
if (property == CASTING_TYPE_PROPERTY) {
if (get) {
return getCastingType();
} else {
setCastingType(value);
return 0;
}
}
// allow default implementation to flag the error
return super.internalGetSetIntProperty(property, get, value);
JAVA
return this.expression;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
// an Assignment may occur inside a Expression - must check cycles
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
if (property == CASTING_TYPE_PROPERTY) {
if (get) {
return getCastingType();
} else {
setCastingType((Integer) value);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetObjectProperty(property, get, value);
JAVA
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression clone = ASTNode.copySubtree(target, this.getExpression());
final CastExpression result = new CastExpression(this.getStart(), this.getEnd(), target, clone, this.getCastingType());
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(CatchClause.class, "className", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(CatchClause.class, "variable", Variable.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(CatchClause.class, "statement", Block.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (variable == null || statement == null) {
throw new IllegalArgumentException();
}
if (!(className instanceof Identifier) && !(className instanceof NamespaceName)) {
throw new IllegalArgumentException();
}
this.className = className;
this.variable = variable;
this.body = statement;
className.setParent(this, CLASS_NAME_PROPERTY);
variable.setParent(this, VARIABLE_PROPERTY);
statement.setParent(this, BODY_PROPERTY);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
className.accept(visitor);
variable.accept(visitor);
body.accept(visitor);
JAVA
accept(visitor);
className.traverseTopDown(visitor);
variable.traverseTopDown(visitor);
body.traverseTopDown(visitor);
JAVA
className.traverseBottomUp(visitor);
variable.traverseBottomUp(visitor);
body.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<CatchClause");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<ClassName>\n");
className.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</ClassName>\n");
variable.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
body.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</CatchClause>");
JAVA
return ASTNode.CATCH_CLAUSE;
JAVA
return body;
JAVA
return this.className;
JAVA
if (!(className instanceof Identifier) && !(className instanceof NamespaceName)) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.className;
preReplaceChild(oldChild, className, CLASS_NAME_PROPERTY);
this.className = className;
postReplaceChild(oldChild, className, CLASS_NAME_PROPERTY);
JAVA
return this.variable;
JAVA
if (variable == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.variable;
preReplaceChild(oldChild, variable, VARIABLE_PROPERTY);
this.variable = variable;
postReplaceChild(oldChild, variable, VARIABLE_PROPERTY);
JAVA
return this.body;
JAVA
if (body == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.body;
preReplaceChild(oldChild, body, BODY_PROPERTY);
this.body = body;
postReplaceChild(oldChild, body, BODY_PROPERTY);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Block body = ASTNode.copySubtree(target, getBody());
final Expression className = ASTNode.copySubtree(target, getClassName());
final Variable variable = ASTNode.copySubtree(target, getVariable());
CatchClause result = new CatchClause(this.getStart(), this.getEnd(), target, className, variable, body);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == CLASS_NAME_PROPERTY) {
if (get) {
return getClassName();
} else {
setClassName((Expression) child);
return null;
}
}
if (property == VARIABLE_PROPERTY) {
if (get) {
return getVariable();
} else {
setVariable((Variable) child);
return null;
}
}
if (property == BODY_PROPERTY) {
if (get) {
return getBody();
} else {
setBody((Block) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
new SimplePropertyDescriptor(Identifier.class, "name", String.class, //$NON-NLS-1$
MANDATORY)
JAVA
super(start, end, ast);
if (value == null) {
throw new IllegalArgumentException();
}
// intern the string for fast equality check
value.intern();
setName(value);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
JAVA
JAVA
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<Identifier");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" name='").append(name).append("'/>");
JAVA
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final Identifier other = (Identifier) obj;
return this.name == other.name;
JAVA
return ASTNode.IDENTIFIER;
JAVA
return name;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
Identifier result = new Identifier(this.getStart(), this.getEnd(), target, this.getName());
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == NAME_PROPERTY) {
if (get) {
return getName();
} else {
setName((String) value);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetObjectProperty(property, get, value);
JAVA
if (value == null) /* || value.length() == 0 */
{
throw new IllegalArgumentException();
}
preValueChange(NAME_PROPERTY);
this.name = value;
postValueChange(NAME_PROPERTY);
JAVA
new ASTNode.NodeList<Identifier>(NAMES_PROPERTY)
JAVA
new ASTNode.NodeList<Expression>(INITIALIZERS_PROPERTY)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(ConstantDeclaration.class, "names", Identifier.class, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(ConstantDeclaration.class, "initializers", Expression.class, CYCLE_RISK)
JAVA
super(start, end, ast);
if (names == null || initializers == null || names.size() != initializers.size()) {
throw new IllegalArgumentException();
}
Iterator<Identifier> iteratorNames = names.iterator();
Iterator<Expression> iteratorInitializers = initializers.iterator();
while (iteratorNames.hasNext()) {
this.names.add(iteratorNames.next());
this.initializers.add(iteratorInitializers.next());
}
JAVA
super(start, end, ast);
if (variablesAndDefaults == null || variablesAndDefaults == null || variablesAndDefaults.size() == 0) {
throw new IllegalArgumentException();
}
for (Iterator iter = variablesAndDefaults.iterator(); iter.hasNext(); ) {
ASTNode[] element = (ASTNode[]) iter.next();
assert element != null && element.length == 2 && element[0] != null && element[1] != null;
this.names.add((Identifier) element[0]);
this.initializers.add((Expression) element[1]);
}
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
Iterator<Identifier> iterator1 = names.iterator();
Iterator<Expression> iterator2 = initializers.iterator();
while (iterator1.hasNext()) {
iterator1.next().accept(visitor);
iterator2.next().accept(visitor);
}
JAVA
accept(visitor);
Iterator<Identifier> iterator1 = names.iterator();
Iterator<Expression> iterator2 = initializers.iterator();
while (iterator1.hasNext()) {
iterator1.next().traverseTopDown(visitor);
iterator2.next().traverseTopDown(visitor);
}
JAVA
Iterator<Identifier> iterator1 = names.iterator();
Iterator<Expression> iterator2 = initializers.iterator();
while (iterator1.hasNext()) {
iterator1.next().traverseBottomUp(visitor);
iterator2.next().traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ConstantDeclaration");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
Iterator<Identifier> iterator1 = names.iterator();
Iterator<Expression> iterator2 = initializers.iterator();
while (iterator1.hasNext()) {
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("<VariableName>\n");
iterator1.next().toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("</VariableName>\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("<InitialValue>\n");
Expression expr = iterator2.next();
if (expr != null) {
expr.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append(//$NON-NLS-1$
"\n");
}
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("</InitialValue>\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</ConstantDeclaration>");
JAVA
return ASTNode.CONSTANT_DECLARATION;
JAVA
return this.initializers;
JAVA
return this.names;
JAVA
if (property == NAMES_PROPERTY) {
return names();
}
if (property == INITIALIZERS_PROPERTY) {
return initializers();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
return initializers.toArray(new Expression[initializers.size()]);
JAVA
return names.toArray(new Identifier[names.size()]);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final List names = ASTNode.copySubtrees(target, this.names());
final List initializers = ASTNode.copySubtrees(target, this.initializers());
final ConstantDeclaration ccd = new ConstantDeclaration(this.getStart(), this.getEnd(), target, names, initializers);
return ccd;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
0
JAVA
1
JAVA
2
JAVA
3
JAVA
new ChildPropertyDescriptor(ClassDeclaration.class, "name", Identifier.class, MANDATORY, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
new ChildListPropertyDescriptor(ClassDeclaration.class, "interfaces", Identifier.class, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
new ChildPropertyDescriptor(ClassDeclaration.class, "body", Block.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new ChildPropertyDescriptor(ClassDeclaration.class, "superClass", Expression.class, OPTIONAL, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(ClassDeclaration.class, "modifier", Integer.class, //$NON-NLS-1$
OPTIONAL)
JAVA
return BODY_PROPERTY;
JAVA
return INTERFACES_PROPERTY;
JAVA
return NAME_PROPERTY;
JAVA
super(start, end, ast, className, interfaces, body);
setModifier(modifier);
if (superClass != null) {
setSuperClass(superClass);
}
JAVA
super(ast);
JAVA
this(start, end, ast, modifier, className, superClass, interfaces == null ? null : (Identifier[]) interfaces.toArray(new Identifier[interfaces.size()]), body);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
getName().accept(visitor);
if (superClass != null) {
superClass.accept(visitor);
}
for (Object object : interfaces()) {
final ASTNode node = (ASTNode) object;
node.accept(visitor);
}
getBody().accept(visitor);
JAVA
accept(visitor);
getName().traverseTopDown(visitor);
if (superClass != null) {
superClass.traverseTopDown(visitor);
}
Identifier[] interfaces = getInterfaces();
for (Object object : interfaces()) {
final ASTNode node = (ASTNode) object;
node.traverseTopDown(visitor);
}
getBody().traverseTopDown(visitor);
JAVA
getName().traverseBottomUp(visitor);
if (superClass != null) {
superClass.traverseBottomUp(visitor);
}
Identifier[] interfaces = getInterfaces();
for (Object object : interfaces()) {
final ASTNode node = (ASTNode) object;
node.traverseBottomUp(visitor);
}
getBody().traverseBottomUp(visitor);
accept(visitor);
JAVA
switch(modifier) {
case MODIFIER_NONE:
//$NON-NLS-1$
return "";
case MODIFIER_ABSTRACT:
//$NON-NLS-1$
return "abstract";
case MODIFIER_FINAL:
//$NON-NLS-1$
return "final";
default:
throw new IllegalArgumentException();
}
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ClassDeclaration");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" modifier='").append(getModifier(modifier)).append("'>\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("<ClassName>\n");
getName().toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("</ClassName>\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("<SuperClassName>\n");
if (superClass != null) {
superClass.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("</SuperClassName>\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("<Interfaces>\n");
for (Object object : interfaces()) {
final ASTNode node = (ASTNode) object;
node.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("</Interfaces>\n");
getBody().toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</ClassDeclaration>");
JAVA
return ASTNode.CLASS_DECLARATION;
JAVA
return modifier;
JAVA
preValueChange(MODIFIER_PROPERTY);
this.modifier = value;
postValueChange(MODIFIER_PROPERTY);
JAVA
return superClass;
JAVA
if (id != null && !(id instanceof Identifier) && !(id instanceof NamespaceName)) {
throw new IllegalArgumentException();
}
// an Assignment may occur inside a Expression - must check cycles
ASTNode oldChild = this.superClass;
preReplaceChild(oldChild, id, SUPER_CLASS_PROPERTY);
this.superClass = id;
postReplaceChild(oldChild, id, SUPER_CLASS_PROPERTY);
JAVA
if (property == SUPER_CLASS_PROPERTY) {
if (get) {
return getSuperClass();
} else {
setSuperClass((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
if (property == MODIFIER_PROPERTY) {
if (get) {
return getModifier();
} else {
setModifier(child);
return 0;
}
}
// allow default implementation to flag the error
return super.internalGetSetIntProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Block body = ASTNode.copySubtree(target, getBody());
final Expression superName = ASTNode.copySubtree(target, getSuperClass());
final int modifier = getModifier();
final List interfaces = ASTNode.copySubtrees(target, interfaces());
final Identifier name = ASTNode.copySubtree(target, getName());
final ClassDeclaration result = new ClassDeclaration(getStart(), getEnd(), target, modifier, name, superName, interfaces, body);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<Expression>(CTOR_PARAMS_PROPERTY)
JAVA
new ChildPropertyDescriptor(ClassInstanceCreation.class, "className", ClassName.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new ChildListPropertyDescriptor(ClassInstanceCreation.class, "ctorParams", Expression.class, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new ChildPropertyDescriptor(ClassInstanceCreation.class, "className", ClassName.class, OPTIONAL, //$NON-NLS-1$
CYCLE_RISK)
JAVA
super(start, end, ast);
if (className == null || ctorParams == null) {
throw new IllegalArgumentException();
}
setClassName(className);
for (Expression expression : ctorParams) {
this.ctorParams.add(expression);
}
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
this(start, end, ast, className, ctorParams == null ? null : (Expression[]) ctorParams.toArray(new Expression[ctorParams.size()]));
JAVA
className.accept(visitor);
for (ASTNode node : this.ctorParams) {
node.accept(visitor);
}
// if (chainingInstanceCall != null) {
// chainingInstanceCall.accept(visitor);
// }
JAVA
accept(visitor);
className.traverseTopDown(visitor);
for (ASTNode node : this.ctorParams) {
node.traverseTopDown(visitor);
}
// if (chainingInstanceCall != null) {
// chainingInstanceCall.traverseTopDown(visitor);
// }
JAVA
className.traverseBottomUp(visitor);
for (ASTNode node : this.ctorParams) {
node.traverseBottomUp(visitor);
}
// if (chainingInstanceCall != null) {
// chainingInstanceCall.traverseBottomUp(visitor);
// }
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ClassInstanceCreation");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
className.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("<ConstructorParameters>\n");
for (ASTNode node : this.ctorParams) {
node.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</ConstructorParameters>\n");
// if (chainingInstanceCall != null) {
// chainingInstanceCall.toString(buffer, TAB + tab);
// buffer.append("\n"); //$NON-NLS-1$
// }
//$NON-NLS-1$
buffer.append(tab).append("</ClassInstanceCreation>");
JAVA
return ASTNode.CLASS_INSTANCE_CREATION;
JAVA
return className;
JAVA
if (classname == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.className;
preReplaceChild(oldChild, classname, CLASSNAME_PROPERTY);
this.className = classname;
postReplaceChild(oldChild, classname, CLASSNAME_PROPERTY);
JAVA
return chainingInstanceCall;
JAVA
this.chainingInstanceCall = chainingInstanceCall;
JAVA
if (property == CLASSNAME_PROPERTY) {
if (get) {
return getClassName();
} else {
setClassName((ClassName) child);
return null;
}
} else if (property == CHAINING_INSTANCE_CALL_PROPERTY) {
if (get) {
return getChainingInstanceCall();
} else {
setChainingInstanceCall((ChainingInstanceCall) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
if (property == CTOR_PARAMS_PROPERTY) {
return ctorParams();
}
return super.internalGetChildListProperty(property);
JAVA
return ctorParams.toArray(new Expression[this.ctorParams.size()]);
JAVA
return this.ctorParams;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final List params = ASTNode.copySubtrees(target, ctorParams());
final ClassName cn = ASTNode.copySubtree(target, getClassName());
final ClassInstanceCreation result = new ClassInstanceCreation(this.getStart(), this.getEnd(), target, cn, params);
return result;
JAVA
AST target = getAST();
final List params = ASTNode.copySubtrees(target, ctorParams());
final ClassName cn = ASTNode.copySubtree(target, getClassName());
final ClassInstanceCreation result = new ClassInstanceCreation(offset, this.getEnd(), target, cn, params);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ClassName.class, "name", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (className == null) {
throw new IllegalArgumentException();
}
setClassName(className);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
name.accept(visitor);
JAVA
accept(visitor);
name.traverseTopDown(visitor);
JAVA
name.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ClassName");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
name.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</ClassName>");
JAVA
return ASTNode.CLASS_NAME;
JAVA
return this.name;
JAVA
return this.name;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.name;
preReplaceChild(oldChild, expression, NAME_PROPERTY);
this.name = expression;
postReplaceChild(oldChild, expression, NAME_PROPERTY);
JAVA
if (property == NAME_PROPERTY) {
if (get) {
return getName();
} else {
setClassName((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getName());
final ClassName result = new ClassName(this.getStart(), this.getEnd(), target, expr);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(CloneExpression.class, "expression", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (expr == null) {
throw new IllegalArgumentException();
}
setExpression(expr);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
expression.accept(visitor);
JAVA
accept(visitor);
expression.traverseTopDown(visitor);
JAVA
expression.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<CloneExpression");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
expression.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</CloneExpression>");
JAVA
return ASTNode.CLONE_EXPRESSION;
JAVA
return expression;
JAVA
return expression;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getExpression());
final CloneExpression result = new CloneExpression(this.getStart(), this.getEnd(), target, expr);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
0
JAVA
1
JAVA
2
JAVA
//$NON-NLS-1$
new SimplePropertyDescriptor(Comment.class, "commentType", Integer.class, MANDATORY)
JAVA
super(start, end, ast);
setCommentType(type);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
JAVA
JAVA
JAVA
switch(type) {
case TYPE_SINGLE_LINE:
return //$NON-NLS-1$
"singleLine";
case TYPE_MULTILINE:
return //$NON-NLS-1$
"multiLine";
case TYPE_PHPDOC:
return //$NON-NLS-1$
"phpDoc";
default:
throw new IllegalArgumentException();
}
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<Comment");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" commentType='").append(getCommentType(commentType)).append("'/>");
JAVA
return ASTNode.COMMENT;
JAVA
return commentType;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Comment result = new Comment(this.getStart(), this.getEnd(), target, this.getCommentType());
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == COMMENT_TYPE_PROPERTY) {
if (get) {
return getCommentType();
} else {
setCommentType(value);
return 0;
}
}
// allow default implementation to flag the error
return super.internalGetSetIntProperty(property, get, value);
JAVA
if (value != TYPE_MULTILINE && value != TYPE_PHPDOC && value != TYPE_SINGLE_LINE) {
throw new IllegalArgumentException();
}
preValueChange(COMMENT_TYPE_PROPERTY);
this.commentType = value;
postValueChange(COMMENT_TYPE_PROPERTY);
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ConditionalExpression.class, "condition", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ConditionalExpression.class, "ifTrue", Expression.class, OPTIONAL, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ConditionalExpression.class, "ifFalse", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
super(ast);
JAVA
super(start, end, ast);
if (condition == null || (ast.apiLevel().isLessThan(PHPVersion.PHP5_3) && ifTrue == null) || ifFalse == null) {
throw new IllegalArgumentException();
}
setCondition(condition);
setIfTrue(ifTrue);
setIfFalse(ifFalse);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
condition.accept(visitor);
if (ifTrue != null) {
ifTrue.accept(visitor);
}
ifFalse.accept(visitor);
JAVA
accept(visitor);
condition.traverseTopDown(visitor);
if (ifTrue != null) {
ifTrue.traverseTopDown(visitor);
}
ifFalse.traverseTopDown(visitor);
JAVA
condition.traverseBottomUp(visitor);
ifTrue.traverseBottomUp(visitor);
ifFalse.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ConditionalExpression");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Condition>\n");
condition.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</Condition>\n");
if (ifTrue != null) {
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<IfTrue>\n");
ifTrue.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</IfTrue>\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<IfFalse>\n");
ifFalse.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</IfFalse>\n");
//$NON-NLS-1$
buffer.append(tab).append("</ConditionalExpression>");
JAVA
return ASTNode.CONDITIONAL_EXPRESSION;
JAVA
return this.condition;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.condition;
preReplaceChild(oldChild, expression, CONDITION_PROPERTY);
this.condition = expression;
postReplaceChild(oldChild, expression, CONDITION_PROPERTY);
JAVA
return ifTrue;
JAVA
if (ast.apiLevel().isLessThan(PHPVersion.PHP5_3) && expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.ifTrue;
preReplaceChild(oldChild, expression, IF_TRUE_PROPERTY);
this.ifTrue = expression;
postReplaceChild(oldChild, expression, IF_TRUE_PROPERTY);
JAVA
return this.ifFalse;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.ifFalse;
preReplaceChild(oldChild, expression, IF_FALSE_PROPERTY);
this.ifFalse = expression;
postReplaceChild(oldChild, expression, IF_FALSE_PROPERTY);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
if (property == CONDITION_PROPERTY) {
if (get) {
return getCondition();
} else {
setCondition((Expression) child);
return null;
}
}
if (property == IF_TRUE_PROPERTY) {
if (get) {
return getIfTrue();
} else {
setIfTrue((Expression) child);
return null;
}
}
if (property == IF_FALSE_PROPERTY) {
if (get) {
return getIfFalse();
} else {
setIfFalse((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
final Expression condition = ASTNode.copySubtree(target, this.getCondition());
final Expression ifTrue = ASTNode.copySubtree(target, this.getIfTrue());
final Expression ifFalse = ASTNode.copySubtree(target, this.getIfTrue());
ConditionalExpression result = new ConditionalExpression(this.getStart(), this.getEnd(), target, condition, ifTrue, ifFalse);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ContinueStatement.class, "expression", Expression.class, OPTIONAL, CYCLE_RISK)
JAVA
this(start, end, ast, null);
JAVA
super(ast);
JAVA
super(start, end, ast);
if (expr != null) {
setExpression(expr);
}
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
if (expression != null) {
expression.accept(visitor);
}
JAVA
accept(visitor);
if (expression != null) {
expression.traverseTopDown(visitor);
}
JAVA
if (expression != null) {
expression.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ContinueStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
if (expression != null) {
expression.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</ContinueStatement>");
JAVA
return ASTNode.CONTINUE_STATEMENT;
JAVA
return expression;
JAVA
return expression;
JAVA
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getExpression());
final ContinueStatement result = new ContinueStatement(this.getStart(), this.getEnd(), target, expr);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<Identifier>(DIRECTIVE_NAMES_PROPERTY)
JAVA
new ASTNode.NodeList<Expression>(DIRECTIVE_VALUES_PROPERTY)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(DeclareStatement.class, "directiveNames", Identifier.class, NO_CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(DeclareStatement.class, "directiveValues", Expression.class, NO_CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(DeclareStatement.class, "action", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (directiveNames == null || directiveValues == null || directiveNames.length != directiveValues.length) {
throw new IllegalArgumentException();
}
for (Identifier identifier : directiveNames) {
this.directiveNames.add(identifier);
}
for (Expression expression : directiveValues) {
this.directiveValues.add(expression);
}
setBody(action);
JAVA
this(start, end, ast, directiveNames == null ? null : (Identifier[]) directiveNames.toArray(new Identifier[directiveNames.size()]), directiveValues == null ? null : (Expression[]) directiveValues.toArray(new Expression[directiveValues.size()]), action);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
final Iterator<Identifier> itId = directiveNames.iterator();
final Iterator<Expression> itExpr = directiveValues.iterator();
while (itId.hasNext()) {
final Identifier name = itId.next();
final Expression value = itExpr.next();
name.accept(visitor);
value.accept(visitor);
}
body.accept(visitor);
JAVA
accept(visitor);
final Iterator<Identifier> itId = directiveNames.iterator();
final Iterator<Expression> itExpr = directiveValues.iterator();
while (itId.hasNext()) {
final Identifier name = itId.next();
final Expression value = itExpr.next();
name.traverseTopDown(visitor);
value.traverseTopDown(visitor);
}
body.traverseTopDown(visitor);
JAVA
final Iterator<Identifier> itId = directiveNames.iterator();
final Iterator<Expression> itExpr = directiveValues.iterator();
while (itId.hasNext()) {
final Identifier name = itId.next();
final Expression value = itExpr.next();
name.traverseBottomUp(visitor);
value.traverseBottomUp(visitor);
}
body.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<DeclareStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("<Directives>\n");
final Iterator<Identifier> itId = directiveNames.iterator();
final Iterator<Expression> itExpr = directiveValues.iterator();
while (itId.hasNext()) {
final Identifier name = itId.next();
final Expression value = itExpr.next();
//$NON-NLS-1$
buffer.append(tab).append(TAB).append(TAB).append("<Name>\n");
name.toString(buffer, TAB + TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append(TAB).append("</Name>\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append(TAB).append("<Value>\n");
value.toString(buffer, TAB + TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append(TAB).append("</Value>\n");
}
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("</Directives>\n");
body.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</DeclareStatement>");
JAVA
return ASTNode.DECLARE_STATEMENT;
JAVA
return body;
JAVA
return directiveNames.toArray(new Identifier[directiveNames.size()]);
JAVA
return directiveValues.toArray(new Expression[directiveValues.size()]);
JAVA
return directiveNames;
JAVA
return directiveValues;
JAVA
return this.body;
JAVA
if (body == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.body;
preReplaceChild(oldChild, body, BODY_PROPERTY);
this.body = body;
postReplaceChild(oldChild, body, BODY_PROPERTY);
JAVA
if (property == BODY_PROPERTY) {
if (get) {
return getBody();
} else {
setBody((Statement) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
if (property == DIRECTIVE_NAMES_PROPERTY) {
return directiveNames();
}
if (property == DIRECTIVE_VALUES_PROPERTY) {
return directiveValues();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final List names = ASTNode.copySubtrees(target, this.directiveNames());
final List values = ASTNode.copySubtrees(target, this.directiveValues());
final Statement body = ASTNode.copySubtree(target, getBody());
final DeclareStatement echoSt = new DeclareStatement(this.getStart(), this.getEnd(), target, names, values, body);
return echoSt;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(DoStatement.class, "condition", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(DoStatement.class, "body", Statement.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (condition == null || body == null) {
throw new IllegalArgumentException();
}
setCondition(condition);
setBody(body);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
condition.accept(visitor);
body.accept(visitor);
JAVA
accept(visitor);
condition.traverseTopDown(visitor);
body.traverseTopDown(visitor);
JAVA
condition.traverseBottomUp(visitor);
body.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<DoStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
body.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Condition>\n");
condition.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</Condition>\n");
//$NON-NLS-1$
buffer.append(tab).append("</DoStatement>");
JAVA
return ASTNode.DO_STATEMENT;
JAVA
return body;
JAVA
return this.body;
JAVA
return this.condition;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.condition;
preReplaceChild(oldChild, expression, CONDITION_PROPERTY);
this.condition = expression;
postReplaceChild(oldChild, expression, CONDITION_PROPERTY);
JAVA
if (body == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.body;
preReplaceChild(oldChild, body, BODY_PROPERTY);
this.body = body;
postReplaceChild(oldChild, body, BODY_PROPERTY);
JAVA
if (property == CONDITION_PROPERTY) {
if (get) {
return getCondition();
} else {
setCondition((Expression) child);
return null;
}
}
if (property == BODY_PROPERTY) {
if (get) {
return getBody();
} else {
setBody((Statement) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Statement body = ASTNode.copySubtree(target, getBody());
final Expression condition = ASTNode.copySubtree(target, getCondition());
final DoStatement result = new DoStatement(this.getStart(), this.getEnd(), target, condition, body);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<Expression>(EXPRESSIONS_PROPERTY)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(EchoStatement.class, "expressions", Expression.class, CYCLE_RISK)
JAVA
super(start, end, ast);
if (expressions == null) {
throw new IllegalArgumentException();
}
for (Expression expression : expressions) {
this.expressions.add(expression);
}
JAVA
this(start, end, ast, (Expression[]) expressions.toArray(new Expression[expressions.size()]));
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
for (ASTNode node : this.expressions) {
node.accept(visitor);
}
JAVA
accept(visitor);
for (ASTNode node : this.expressions) {
node.traverseTopDown(visitor);
}
JAVA
for (ASTNode node : this.expressions) {
node.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<EchoStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
for (ASTNode node : this.expressions) {
node.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</EchoStatement>");
JAVA
return ASTNode.ECHO_STATEMENT;
JAVA
return this.expressions.toArray(new Expression[this.expressions.size()]);
JAVA
return this.expressions;
JAVA
if (property == EXPRESSIONS_PROPERTY) {
return expressions();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final List expressions = ASTNode.copySubtrees(target, this.expressions());
final EchoStatement echoSt = new EchoStatement(this.getStart(), this.getEnd(), target, expressions);
return echoSt;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
super(start, end, ast);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
JAVA
accept(visitor);
JAVA
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<EmptyStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append("/>");
JAVA
return ASTNode.EMPTY_STATEMENT;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final ASTNode result = new EmptyStatement(this.getStart(), this.getEnd(), target);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ExpressionStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (expr == null) {
throw new IllegalArgumentException();
}
setExpression(expr);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
expression.accept(visitor);
JAVA
accept(visitor);
expression.traverseTopDown(visitor);
JAVA
expression.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ExpressionStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
expression.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</ExpressionStatement>");
JAVA
return ASTNode.EXPRESSION_STATEMENT;
JAVA
return expression;
JAVA
return expression;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getExpression());
final ExpressionStatement result = new ExpressionStatement(this.getStart(), this.getEnd(), target, expr);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ChildPropertyDescriptor(FieldAccess.class, "dispatcher", VariableBase.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new ChildPropertyDescriptor(FieldAccess.class, "field", Variable.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
return FieldAccess.DISPATCHER_PROPERTY;
JAVA
super(start, end, ast, dispatcher);
if (field == null) {
throw new IllegalArgumentException();
}
setField(field);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
getDispatcher().accept(visitor);
field.accept(visitor);
JAVA
accept(visitor);
getDispatcher().accept(visitor);
field.traverseTopDown(visitor);
JAVA
getDispatcher().traverseBottomUp(visitor);
field.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<FieldAccess");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Dispatcher>\n");
getDispatcher().toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</Dispatcher>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Property>\n");
field.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</Property>\n");
//$NON-NLS-1$
buffer.append(tab).append("</FieldAccess>");
JAVA
return ASTNode.FIELD_ACCESS;
JAVA
return field;
JAVA
return getField();
JAVA
if (variable == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.field;
preReplaceChild(oldChild, variable, FIELD_PROPERTY);
this.field = variable;
postReplaceChild(oldChild, variable, FIELD_PROPERTY);
JAVA
if (property == FIELD_PROPERTY) {
if (get) {
return getField();
} else {
setField((Variable) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final VariableBase dispatcher = ASTNode.copySubtree(target, getDispatcher());
final Variable field = ASTNode.copySubtree(target, getField());
final FieldAccess result = new FieldAccess(getStart(), getEnd(), target, dispatcher, field);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<SingleFieldDeclaration>(FIELDS_PROPERTY)
JAVA
new ChildListPropertyDescriptor(FieldsDeclaration.class, "fields", SingleFieldDeclaration.class, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(FieldsDeclaration.class, "modifier", Integer.class, //$NON-NLS-1$
OPTIONAL)
JAVA
return MODIFIER_PROPERTY;
JAVA
super(start, end, ast, modifier);
if (variablesAndDefaults == null || variablesAndDefaults.size() == 0) {
throw new IllegalArgumentException();
}
for (Iterator iter = variablesAndDefaults.iterator(); iter.hasNext(); ) {
final Object next = iter.next();
if (next instanceof SingleFieldDeclaration) {
this.fields.add((SingleFieldDeclaration) next);
} else {
ASTNode[] element = (ASTNode[]) next;
SingleFieldDeclaration field = createField(ast, (Variable) element[0], (Expression) element[1]);
this.fields.add(field);
}
}
JAVA
super(ast);
JAVA
int start = name.getStart();
int end = value == null ? name.getEnd() : value.getEnd();
final SingleFieldDeclaration result = new SingleFieldDeclaration(start, end, ast, name, value);
return result;
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
for (ASTNode node : this.fields) {
node.accept(visitor);
}
JAVA
accept(visitor);
for (ASTNode node : this.fields) {
node.traverseTopDown(visitor);
}
JAVA
for (ASTNode node : this.fields) {
node.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<FieldsDeclaration");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" modifier='").append(getModifierString()).append("'>\n");
for (SingleFieldDeclaration node : this.fields) {
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("<VariableName>\n");
node.getName().toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("</VariableName>\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("<InitialValue>\n");
Expression expr = node.getValue();
if (expr != null) {
expr.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append(//$NON-NLS-1$
"\n");
}
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("</InitialValue>\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</FieldsDeclaration>");
JAVA
return ASTNode.FIELD_DECLARATION;
JAVA
return this.fields;
JAVA
Expression[] result = new Expression[this.fields.size()];
int i = 0;
for (SingleFieldDeclaration field : this.fields) {
result[i++] = field.getValue();
}
return result;
JAVA
Variable[] result = new Variable[this.fields.size()];
int i = 0;
for (SingleFieldDeclaration field : this.fields) {
result[i++] = field.getName();
}
return result;
JAVA
if (property == FIELDS_PROPERTY) {
return fields();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final List fields = ASTNode.copySubtrees(target, fields());
final int modifier = getModifier();
final FieldsDeclaration result = new FieldsDeclaration(getStart(), getEnd(), target, modifier, fields);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(SingleFieldDeclaration.class, "name", Variable.class, MANDATORY, NO_CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(SingleFieldDeclaration.class, "value", Expression.class, OPTIONAL, CYCLE_RISK)
JAVA
super(ast);
JAVA
super(start, end, ast);
if (name == null) {
throw new IllegalArgumentException();
}
setName(name);
if (value != null) {
setValue(value);
}
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
name.accept(visitor);
if (value != null) {
value.accept(visitor);
}
JAVA
accept(visitor);
name.accept(visitor);
if (value != null) {
value.traverseTopDown(visitor);
}
JAVA
name.accept(visitor);
if (value != null) {
value.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<SingleFieldDeclaration");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("'>\n").append(tab).append(TAB).append("<VariableName>\n");
name.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("</VariableName>\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("<InitialValue>\n");
if (value != null) {
value.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("</InitialValue>\n");
//$NON-NLS-1$
buffer.append(tab).append("</SingleFieldDeclaration>");
JAVA
return ASTNode.SINGLE_FIELD_DECLARATION;
JAVA
return this.name;
JAVA
if (name == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.name;
preReplaceChild(oldChild, name, NAME_PROPERTY);
this.name = name;
postReplaceChild(oldChild, name, NAME_PROPERTY);
JAVA
return this.value;
JAVA
ASTNode oldChild = this.value;
preReplaceChild(oldChild, value, VALUE_PROPERTY);
this.value = value;
postReplaceChild(oldChild, value, VALUE_PROPERTY);
JAVA
if (property == NAME_PROPERTY) {
if (get) {
return getName();
} else {
setName((Variable) child);
return null;
}
}
if (property == VALUE_PROPERTY) {
if (get) {
return getValue();
} else {
setValue((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Variable name = ASTNode.copySubtree(target, getName());
final Expression value = ASTNode.copySubtree(target, getValue());
final SingleFieldDeclaration result = new SingleFieldDeclaration(getStart(), getEnd(), target, name, value);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ForEachStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ForEachStatement.class, "key", Expression.class, OPTIONAL, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ForEachStatement.class, "value", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ForEachStatement.class, "statement", Statement.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (expression == null || value == null || statement == null) {
throw new IllegalArgumentException();
}
setExpression(expression);
setValue(value);
setStatement(statement);
if (key != null) {
setKey(key);
}
JAVA
super(ast);
JAVA
this(start, end, ast, expression, null, value, statement);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
expression.accept(visitor);
if (key != null) {
key.accept(visitor);
}
value.accept(visitor);
statement.accept(visitor);
JAVA
accept(visitor);
expression.traverseTopDown(visitor);
if (key != null) {
key.traverseTopDown(visitor);
}
value.traverseTopDown(visitor);
statement.traverseTopDown(visitor);
JAVA
expression.traverseBottomUp(visitor);
if (key != null) {
key.traverseBottomUp(visitor);
}
value.traverseBottomUp(visitor);
statement.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ForEachStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Expression>\n");
expression.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</Expression>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Key>\n");
if (key != null) {
key.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</Key>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Value>\n");
value.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</Value>\n");
statement.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</ForEachStatement>");
JAVA
return ASTNode.FOR_EACH_STATEMENT;
JAVA
return this.expression;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
return key;
JAVA
ASTNode oldChild = this.key;
preReplaceChild(oldChild, key, KEY_PROPERTY);
this.key = key;
postReplaceChild(oldChild, key, KEY_PROPERTY);
JAVA
return this.value;
JAVA
if (value == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.value;
preReplaceChild(oldChild, value, VALUE_PROPERTY);
this.value = value;
postReplaceChild(oldChild, value, VALUE_PROPERTY);
JAVA
return this.statement;
JAVA
if (statement == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.statement;
preReplaceChild(oldChild, statement, STATEMENT_PROPERTY);
this.statement = statement;
postReplaceChild(oldChild, statement, STATEMENT_PROPERTY);
JAVA
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
if (property == KEY_PROPERTY) {
if (get) {
return getKey();
} else {
setKey((Expression) child);
return null;
}
}
if (property == VALUE_PROPERTY) {
if (get) {
return getValue();
} else {
setValue((Expression) child);
return null;
}
}
if (property == STATEMENT_PROPERTY) {
if (get) {
return getStatement();
} else {
setStatement((Statement) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getExpression());
final Expression key = ASTNode.copySubtree(target, getKey());
final Expression value = ASTNode.copySubtree(target, getValue());
final Statement stm = ASTNode.copySubtree(target, getStatement());
final ForEachStatement result = new ForEachStatement(this.getStart(), this.getEnd(), target, expr, key, value, stm);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ChildPropertyDescriptor(FormalParameter.class, "parameterType", Expression.class, OPTIONAL, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new ChildPropertyDescriptor(FormalParameter.class, "expression", Expression.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new ChildPropertyDescriptor(FormalParameter.class, "defaultValue", Expression.class, OPTIONAL, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(FormalParameter.class, "isMandatory", Boolean.class, //$NON-NLS-1$
OPTIONAL)
JAVA
return apiLevel == PHPVersion.PHP4 ? PROPERTY_DESCRIPTORS_PHP4 : PROPERTY_DESCRIPTORS_PHP5;
JAVA
super(start, end, ast);
if (parameterName == null) {
throw new IllegalArgumentException();
}
setParameterName(parameterName);
if (type != null) {
setParameterType(type);
}
if (defaultValue != null) {
setDefaultValue(defaultValue);
}
setIsMandatory(isMandatory);
JAVA
super(ast);
JAVA
this(start, end, ast, type, parameterName, defaultValue, false);
JAVA
this(start, end, ast, type, parameterName, defaultValue, false);
JAVA
this(start, end, ast, type, parameterName, null, false);
JAVA
this(start, end, ast, type, parameterName, null, isMandatory);
JAVA
this(start, end, ast, type, parameterName, null, false);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
if (parameterType != null) {
parameterType.accept(visitor);
}
parameterName.accept(visitor);
if (defaultValue != null) {
defaultValue.accept(visitor);
}
JAVA
accept(visitor);
if (parameterType != null) {
parameterType.traverseTopDown(visitor);
}
parameterName.traverseTopDown(visitor);
if (defaultValue != null) {
defaultValue.traverseTopDown(visitor);
}
JAVA
if (parameterType != null) {
parameterType.traverseBottomUp(visitor);
}
parameterName.traverseBottomUp(visitor);
if (defaultValue != null) {
defaultValue.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<FormalParameter");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" isMandatory='").append(isMandatory).append("'>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Type>\n");
if (parameterType != null) {
parameterType.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</Type>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<ParameterName>\n");
parameterName.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</ParameterName>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<DefaultValue>\n");
if (defaultValue != null) {
defaultValue.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</DefaultValue>\n");
//$NON-NLS-1$
buffer.append(tab).append("</FormalParameter>");
JAVA
return ASTNode.FORMAL_PARAMETER;
JAVA
return defaultValue;
JAVA
// an Assignment may occur inside a Expression - must check cycles
ASTNode oldChild = this.defaultValue;
preReplaceChild(oldChild, value, DEFAULT_VALUE_PROPERTY);
this.defaultValue = value;
postReplaceChild(oldChild, value, DEFAULT_VALUE_PROPERTY);
JAVA
return isMandatory;
JAVA
preValueChange(IS_MANDATORY_PROPERTY);
this.isMandatory = isMandatory;
postValueChange(IS_MANDATORY_PROPERTY);
JAVA
return parameterName;
JAVA
if (name == null) {
throw new IllegalArgumentException();
}
// an Assignment may occur inside a Expression - must check cycles
ASTNode oldChild = this.parameterName;
preReplaceChild(oldChild, name, PARAMETER_NAME_PROPERTY);
this.parameterName = name;
postReplaceChild(oldChild, name, PARAMETER_NAME_PROPERTY);
JAVA
return parameterType;
JAVA
if (id != null && !(id instanceof Identifier) && !(id instanceof NamespaceName)) {
throw new IllegalArgumentException();
}
// // an Assignment may occur inside a Expression - must check cycles
Expression oldChild = this.parameterType;
preReplaceChild(oldChild, id, PARAMETER_TYPE_PROPERTY);
this.parameterType = id;
postReplaceChild(oldChild, id, PARAMETER_TYPE_PROPERTY);
JAVA
if (property == IS_MANDATORY_PROPERTY) {
if (get) {
return isMandatory();
} else {
setIsMandatory(value);
return false;
}
}
// allow default implementation to flag the error
return super.internalGetSetBooleanProperty(property, get, value);
JAVA
if (property == PARAMETER_NAME_PROPERTY) {
if (get) {
return getParameterName();
} else {
setParameterName((Expression) child);
return null;
}
}
if (property == PARAMETER_TYPE_PROPERTY) {
if (get) {
return getParameterType();
} else {
setParameterType((Expression) child);
return null;
}
}
if (property == DEFAULT_VALUE_PROPERTY) {
if (get) {
return getDefaultValue();
} else {
setDefaultValue((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
Expression expression = parameterName;
switch(parameterName.getType()) {
case ASTNode.REFERENCE:
expression = ((Reference) expression).getExpression();
if (expression.getType() != ASTNode.VARIABLE) {
throw new IllegalStateException();
}
case ASTNode.VARIABLE:
final Identifier variableName = (Identifier) ((Variable) expression).getName();
return variableName;
}
throw new IllegalStateException();
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression name = ASTNode.copySubtree(target, this.getParameterName());
final Expression type = ASTNode.copySubtree(target, this.getParameterType());
final Expression value = ASTNode.copySubtree(target, this.getDefaultValue());
final boolean isMandatory = this.isMandatory();
final FormalParameter result = new FormalParameter(this.getStart(), this.getEnd(), target, type, name, value, isMandatory);
return result;
JAVA
return defaultValue != null && defaultValue.getLength() > 0;
JAVA
new ASTNode.NodeList<Expression>(INITIALIZERS_PROPERTY)
JAVA
new ASTNode.NodeList<Expression>(EXPRESSION_PROPERTY)
JAVA
new ASTNode.NodeList<Expression>(UPDATERS_PROPERTY)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(ForStatement.class, "initializers", Expression.class, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(ForStatement.class, "conditions", Expression.class, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(ForStatement.class, "updaters", Expression.class, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ForStatement.class, "body", Statement.class, MANDATORY, CYCLE_RISK)
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
super(start, end, ast);
if (initializations == null || conditions == null || increasements == null || action == null) {
throw new IllegalArgumentException();
}
for (Expression init : initializations) {
this.initializers.add(init);
}
for (Expression cond : conditions) {
this.conditions.add(cond);
}
for (Expression inc : increasements) {
this.updaters.add(inc);
}
setBody(action);
JAVA
this(start, end, ast, initializations == null ? null : (Expression[]) initializations.toArray(new Expression[initializations.size()]), conditions == null ? null : (Expression[]) conditions.toArray(new Expression[conditions.size()]), increasements == null ? null : (Expression[]) increasements.toArray(new Expression[increasements.size()]), action);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
for (ASTNode node : this.initializers) {
node.accept(visitor);
}
for (ASTNode node : this.conditions) {
node.accept(visitor);
}
for (ASTNode node : this.updaters) {
node.accept(visitor);
}
body.accept(visitor);
JAVA
for (ASTNode node : this.initializers) {
node.traverseTopDown(visitor);
}
for (ASTNode node : this.conditions) {
node.traverseTopDown(visitor);
}
for (ASTNode node : this.updaters) {
node.traverseTopDown(visitor);
}
body.traverseTopDown(visitor);
JAVA
for (ASTNode node : this.initializers) {
node.traverseBottomUp(visitor);
}
for (ASTNode node : this.conditions) {
node.traverseBottomUp(visitor);
}
for (ASTNode node : this.updaters) {
node.traverseBottomUp(visitor);
}
body.traverseBottomUp(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ForStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Initializations>\n");
for (ASTNode node : this.initializers) {
node.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</Initializations>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Conditions>\n");
for (ASTNode node : this.conditions) {
node.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</Conditions>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Increasements>\n");
for (ASTNode node : this.updaters) {
node.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</Increasements>\n");
body.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</ForStatement>");
JAVA
return ASTNode.FOR_STATEMENT;
JAVA
return this.initializers;
JAVA
return this.conditions;
JAVA
return this.updaters;
JAVA
return this.body;
JAVA
if (statement == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.body;
preReplaceChild(oldChild, statement, BODY_PROPERTY);
this.body = statement;
postReplaceChild(oldChild, statement, BODY_PROPERTY);
JAVA
return body;
JAVA
return conditions.toArray(new Expression[conditions.size()]);
JAVA
return updaters.toArray(new Expression[conditions.size()]);
JAVA
return initializers.toArray(new Expression[conditions.size()]);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final List inits = ASTNode.copySubtrees(target, initializers());
final List conds = ASTNode.copySubtrees(target, conditions());
final List updtaters = ASTNode.copySubtrees(target, updaters());
final Statement body = ASTNode.copySubtree(target, getBody());
ForStatement result = new ForStatement(this.getStart(), this.getEnd(), target, inits, conds, updtaters, body);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == INITIALIZERS_PROPERTY) {
return initializers();
}
if (property == EXPRESSION_PROPERTY) {
return conditions();
}
if (property == UPDATERS_PROPERTY) {
return updaters();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
if (property == BODY_PROPERTY) {
if (get) {
return getBody();
} else {
setBody((Block) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
new ASTNode.NodeList<FormalParameter>(FORMAL_PARAMETERS_PROPERTY)
JAVA
//$NON-NLS-1$
new SimplePropertyDescriptor(FunctionDeclaration.class, "isReference", Boolean.class, OPTIONAL)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(FunctionDeclaration.class, "name", Identifier.class, MANDATORY, NO_CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(FunctionDeclaration.class, "formalParameters", FormalParameter.class, NO_CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(FunctionDeclaration.class, "body", Block.class, OPTIONAL, CYCLE_RISK)
JAVA
super(start, end, ast);
if (functionName == null || formalParameters == null) {
throw new IllegalArgumentException();
}
setIsReference(isReference);
setFunctionName(functionName);
if (formalParameters != null) {
for (FormalParameter formalParameter : formalParameters) {
this.formalParameters.add(formalParameter);
}
}
if (body != null) {
setBody(body);
}
JAVA
this(start, end, ast, functionName, (FormalParameter[]) formalParameters.toArray(new FormalParameter[formalParameters.size()]), body, isReference);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
name.accept(visitor);
for (ASTNode node : this.formalParameters) {
node.accept(visitor);
}
if (body != null) {
body.accept(visitor);
}
JAVA
accept(visitor);
name.traverseTopDown(visitor);
for (ASTNode node : this.formalParameters) {
node.traverseTopDown(visitor);
}
if (body != null) {
body.traverseTopDown(visitor);
}
JAVA
name.traverseBottomUp(visitor);
for (ASTNode node : this.formalParameters) {
node.traverseBottomUp(visitor);
}
if (body != null) {
body.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<FunctionDeclaration");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" isReference='").append(isReference).append("'>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<FunctionName>\n");
name.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</FunctionName>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<FormalParameters>\n");
for (ASTNode node : this.formalParameters) {
node.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</FormalParameters>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<FunctionBody>\n");
if (body != null) {
body.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</FunctionBody>\n");
//$NON-NLS-1$
buffer.append(tab).append("</FunctionDeclaration>");
JAVA
return ASTNode.FUNCTION_DECLARATION;
JAVA
return body;
JAVA
if (body == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.body;
preReplaceChild(oldChild, body, BODY_PROPERTY);
this.body = body;
postReplaceChild(oldChild, body, BODY_PROPERTY);
JAVA
return formalParameters.toArray(new FormalParameter[this.formalParameters.size()]);
JAVA
return this.formalParameters;
JAVA
return name;
JAVA
if (name == null) {
throw new IllegalArgumentException();
}
// an Assignment may occur inside a Expression - must check cycles
ASTNode oldChild = this.name;
preReplaceChild(oldChild, name, NAME_PROPERTY);
this.name = name;
postReplaceChild(oldChild, name, NAME_PROPERTY);
JAVA
return isReference;
JAVA
preValueChange(IS_REFERENCE_PROPERTY);
this.isReference = value;
postValueChange(IS_REFERENCE_PROPERTY);
JAVA
if (property == IS_REFERENCE_PROPERTY) {
if (get) {
return isReference();
} else {
setIsReference(value);
return false;
}
}
// allow default implementation to flag the error
return super.internalGetSetBooleanProperty(property, get, value);
JAVA
if (property == NAME_PROPERTY) {
if (get) {
return getFunctionName();
} else {
setFunctionName((Identifier) child);
return null;
}
}
if (property == BODY_PROPERTY) {
if (get) {
return getBody();
} else {
setBody((Block) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
if (property == FORMAL_PARAMETERS_PROPERTY) {
return formalParameters();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Block body = ASTNode.copySubtree(target, getBody());
final Identifier function = ASTNode.copySubtree(target, getFunctionName());
final List formalParams = ASTNode.copySubtrees(target, formalParameters());
final boolean isRef = isReference();
final FunctionDeclaration result = new FunctionDeclaration(getStart(), getEnd(), target, function, formalParams, body, isRef);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<Expression>(PARAMETERS_PROPERTY)
JAVA
new ChildPropertyDescriptor(FunctionInvocation.class, "functionName", FunctionName.class, MANDATORY, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
new ChildListPropertyDescriptor(FunctionInvocation.class, "parameters", Expression.class, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new ChildPropertyDescriptor(FunctionInvocation.class, "arrayDereferenceList", PHPArrayDereferenceList.class, OPTIONAL, //$NON-NLS-1$
CYCLE_RISK)
JAVA
super(start, end, ast);
if (functionName == null || parameters == null) {
throw new IllegalArgumentException();
}
setFunctionName(functionName);
for (Expression expression : parameters) {
this.parameters.add(expression);
}
this.arrayDereferenceList = arrayDereferenceList;
JAVA
super(ast);
JAVA
this(start, end, ast, functionName, parameters == null ? null : (Expression[]) parameters.toArray(new Expression[parameters.size()]), null);
JAVA
this(start, end, ast, functionName, parameters == null ? null : (Expression[]) parameters.toArray(new Expression[parameters.size()]), arrayDereferenceList);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
functionName.accept(visitor);
for (ASTNode node : parameters) {
node.accept(visitor);
}
if (arrayDereferenceList != null) {
arrayDereferenceList.accept(visitor);
}
JAVA
accept(visitor);
functionName.traverseTopDown(visitor);
for (ASTNode node : parameters) {
node.traverseTopDown(visitor);
}
if (arrayDereferenceList != null) {
arrayDereferenceList.traverseTopDown(visitor);
}
JAVA
functionName.traverseBottomUp(visitor);
for (ASTNode node : parameters) {
node.traverseBottomUp(visitor);
}
if (arrayDereferenceList != null) {
arrayDereferenceList.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<FunctionInvocation");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
functionName.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Parameters>\n");
for (ASTNode node : parameters) {
node.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</Parameters>\n");
if (arrayDereferenceList != null) {
arrayDereferenceList.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</FunctionInvocation>");
JAVA
return ASTNode.FUNCTION_INVOCATION;
JAVA
return functionName;
JAVA
if (functionname == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.functionName;
preReplaceChild(oldChild, functionname, FUNCTION_PROPERTY);
this.functionName = functionname;
postReplaceChild(oldChild, functionname, FUNCTION_PROPERTY);
JAVA
return arrayDereferenceList;
JAVA
this.arrayDereferenceList = arrayDereferenceList;
JAVA
if (property == FUNCTION_PROPERTY) {
if (get) {
return getFunctionName();
} else {
setFunctionName((FunctionName) child);
return null;
}
} else if (property == ARRAY_DEREFERENCE_LIST) {
if (get) {
return getArrayDereferenceList();
} else {
setArrayDereferenceList((PHPArrayDereferenceList) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
if (property == PARAMETERS_PROPERTY) {
return parameters();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
return parameters.toArray(new Expression[parameters.size()]);
JAVA
return parameters;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final FunctionName function = ASTNode.copySubtree(target, getFunctionName());
final List params = ASTNode.copySubtrees(target, parameters());
PHPArrayDereferenceList newArrayDereferenceList = null;
if (arrayDereferenceList != null) {
newArrayDereferenceList = ASTNode.copySubtree(target, arrayDereferenceList);
}
final FunctionInvocation result = new FunctionInvocation(getStart(), getEnd(), target, function, params, newArrayDereferenceList);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(FunctionName.class, "functionName", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (functionName == null) {
throw new IllegalArgumentException();
}
setName(functionName);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
name.accept(visitor);
JAVA
accept(visitor);
name.traverseTopDown(visitor);
JAVA
name.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<FunctionName");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
name.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</FunctionName>");
JAVA
return ASTNode.FUNCTION_NAME;
JAVA
return this.name;
JAVA
return this.name;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.name;
preReplaceChild(oldChild, expression, NAME_PROPERTY);
this.name = expression;
postReplaceChild(oldChild, expression, NAME_PROPERTY);
JAVA
if (property == NAME_PROPERTY) {
if (get) {
return getName();
} else {
setName((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getName());
final FunctionName result = new FunctionName(this.getStart(), this.getEnd(), target, expr);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<Variable>(VARIABLES_PROPERTY)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(GlobalStatement.class, "variables", Variable.class, CYCLE_RISK)
JAVA
super(start, end, ast);
if (variables == null) {
throw new IllegalArgumentException();
}
for (Variable variable : variables) {
this.variables.add(variable);
}
JAVA
this(start, end, ast, variables == null ? null : (Variable[]) variables.toArray(new Variable[variables.size()]));
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
for (ASTNode node : this.variables) {
node.accept(visitor);
}
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
for (ASTNode node : this.variables) {
node.traverseTopDown(visitor);
}
}
JAVA
for (ASTNode node : this.variables) {
node.traverseBottomUp(visitor);
}
visitor.visit(this);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<GlobalStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
for (ASTNode node : this.variables) {
node.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</GlobalStatement>");
JAVA
return ASTNode.GLOBAL_STATEMENT;
JAVA
return variables.toArray(new Variable[this.variables.size()]);
JAVA
return this.variables;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final List variables = ASTNode.copySubtrees(target, variables());
GlobalStatement result = new GlobalStatement(this.getStart(), this.getEnd(), target, variables);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == VARIABLES_PROPERTY) {
return variables();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(IfStatement.class, "condition", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(IfStatement.class, "trueStatement", Statement.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(IfStatement.class, "falseStatement", Statement.class, OPTIONAL, CYCLE_RISK)
JAVA
super(start, end, ast);
if (condition == null || trueStatement == null) {
throw new IllegalArgumentException();
}
setCondition(condition);
setTrueStatement(trueStatement);
if (falseStatement != null) {
setFalseStatement(falseStatement);
}
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
condition.accept(visitor);
trueStatement.accept(visitor);
if (falseStatement != null) {
falseStatement.accept(visitor);
}
JAVA
accept(visitor);
condition.traverseTopDown(visitor);
trueStatement.traverseTopDown(visitor);
if (falseStatement != null) {
falseStatement.traverseTopDown(visitor);
}
JAVA
condition.traverseBottomUp(visitor);
trueStatement.traverseBottomUp(visitor);
if (falseStatement != null) {
falseStatement.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<IfStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Condition>\n");
condition.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</Condition>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<TrueStatement>\n");
trueStatement.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</TrueStatement>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<FalseStatement>\n");
if (falseStatement != null) {
falseStatement.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</FalseStatement>\n");
//$NON-NLS-1$
buffer.append(tab).append("</IfStatement>");
JAVA
return ASTNode.IF_STATEMENT;
JAVA
return this.condition;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.condition;
preReplaceChild(oldChild, expression, CONDITION_PROPERTY);
this.condition = expression;
postReplaceChild(oldChild, expression, CONDITION_PROPERTY);
JAVA
return this.trueStatement;
JAVA
if (statement == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.trueStatement;
preReplaceChild(oldChild, statement, TRUE_STATEMENT_PROPERTY);
this.trueStatement = statement;
postReplaceChild(oldChild, statement, TRUE_STATEMENT_PROPERTY);
JAVA
return this.falseStatement;
JAVA
ASTNode oldChild = this.falseStatement;
preReplaceChild(oldChild, statement, FALSE_STATEMENT_PROPERTY);
this.falseStatement = statement;
postReplaceChild(oldChild, statement, FALSE_STATEMENT_PROPERTY);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
Expression condition = ASTNode.copySubtree(target, getCondition());
Statement trueStatement = ASTNode.copySubtree(target, getTrueStatement());
Statement falseStatement = ASTNode.copySubtree(target, getFalseStatement());
final IfStatement result = new IfStatement(this.getStart(), this.getEnd(), target, condition, trueStatement, falseStatement);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == CONDITION_PROPERTY) {
if (get) {
return getCondition();
} else {
setCondition((Expression) child);
return null;
}
}
if (property == TRUE_STATEMENT_PROPERTY) {
if (get) {
return getTrueStatement();
} else {
setTrueStatement((Statement) child);
return null;
}
}
if (property == FALSE_STATEMENT_PROPERTY) {
if (get) {
return getFalseStatement();
} else {
setFalseStatement((Statement) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(IgnoreError.class, "expression", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
this(start, end, ast, null);
JAVA
super(ast);
JAVA
super(start, end, ast);
if (expr == null) {
throw new IllegalArgumentException();
}
setExpression(expr);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
expression.accept(visitor);
JAVA
accept(visitor);
expression.traverseTopDown(visitor);
JAVA
expression.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<IgnoreError");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
expression.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</IgnoreError>");
JAVA
return ASTNode.IGNORE_ERROR;
JAVA
return expression;
JAVA
return expression;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getExpression());
final IgnoreError result = new IgnoreError(this.getStart(), this.getEnd(), target, expr);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
0
JAVA
1
JAVA
2
JAVA
3
JAVA
new ChildPropertyDescriptor(Include.class, "expression", Expression.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(Include.class, "includeType", Integer.class, //$NON-NLS-1$
MANDATORY)
JAVA
super(start, end, ast);
if (expr == null) {
throw new IllegalArgumentException();
}
setExpression(expr);
setIncludetype(type);
JAVA
super(ast);
JAVA
switch(type) {
case IT_REQUIRE:
//$NON-NLS-1$
return "require";
case IT_REQUIRE_ONCE:
//$NON-NLS-1$
return "require_once";
case IT_INCLUDE:
//$NON-NLS-1$
return "include";
case IT_INCLUDE_ONCE:
//$NON-NLS-1$
return "include_once";
default:
throw new IllegalArgumentException();
}
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
expression.accept(visitor);
JAVA
accept(visitor);
expression.traverseTopDown(visitor);
JAVA
expression.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<Include");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" kind='").append(getType(includeType)).append("'>\n");
expression.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</Include>");
JAVA
return ASTNode.INCLUDE;
JAVA
return expression;
JAVA
return expression;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
return this.includeType;
JAVA
if (getType(value) == null) {
throw new IllegalArgumentException();
}
preValueChange(INCLUDE_TYPE_PROPERTY);
this.includeType = value;
postValueChange(INCLUDE_TYPE_PROPERTY);
JAVA
if (property == INCLUDE_TYPE_PROPERTY) {
if (get) {
return getIncludeType();
} else {
setIncludetype(value);
return 0;
}
}
// allow default implementation to flag the error
return super.internalGetSetIntProperty(property, get, value);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final int type = getIncludeType();
final Expression expr = ASTNode.copySubtree(target, getExpression());
final Include result = new Include(getStart(), getEnd(), target, expr, type);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
0
JAVA
1
JAVA
2
JAVA
3
JAVA
4
JAVA
5
JAVA
6
JAVA
7
JAVA
8
JAVA
9
JAVA
10
JAVA
11
JAVA
12
JAVA
13
JAVA
14
JAVA
15
JAVA
16
JAVA
17
JAVA
18
JAVA
19
JAVA
20
JAVA
21
JAVA
22
JAVA
23
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(InfixExpression.class, "left", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new SimplePropertyDescriptor(InfixExpression.class, "operator", Integer.class, MANDATORY)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(InfixExpression.class, "right", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (right == null || left == null || getOperator(operator) == null) {
throw new IllegalArgumentException();
}
setLeft(left);
setOperator(operator);
setRight(right);
JAVA
super(ast);
JAVA
switch(operator) {
case OP_IS_IDENTICAL:
//$NON-NLS-1$
return "===";
case OP_IS_NOT_IDENTICAL:
//$NON-NLS-1$
return "!==";
case OP_IS_EQUAL:
//$NON-NLS-1$
return "==";
case OP_IS_NOT_EQUAL:
//$NON-NLS-1$
return "!=";
case OP_RGREATER:
//$NON-NLS-1$
return "<";
case OP_IS_SMALLER_OR_EQUAL:
//$NON-NLS-1$
return "<=";
case OP_LGREATER:
//$NON-NLS-1$
return ">";
case OP_IS_GREATER_OR_EQUAL:
//$NON-NLS-1$
return ">=";
case OP_BOOL_OR:
//$NON-NLS-1$
return "||";
case OP_BOOL_AND:
//$NON-NLS-1$
return "&&";
case OP_STRING_OR:
//$NON-NLS-1$
return "or";
case OP_STRING_AND:
//$NON-NLS-1$
return "and";
case OP_STRING_XOR:
//$NON-NLS-1$
return "xor";
case OP_OR:
//$NON-NLS-1$
return "|";
case OP_AND:
//$NON-NLS-1$
return "&";
case OP_XOR:
//$NON-NLS-1$
return "^";
case OP_CONCAT:
//$NON-NLS-1$
return ".";
case OP_PLUS:
//$NON-NLS-1$
return "+";
case OP_MINUS:
//$NON-NLS-1$
return "-";
case OP_MUL:
//$NON-NLS-1$
return "*";
case OP_DIV:
//$NON-NLS-1$
return "/";
case OP_MOD:
//$NON-NLS-1$
return "%";
case OP_SL:
//$NON-NLS-1$
return "<<";
case OP_SR:
//$NON-NLS-1$
return ">>";
default:
throw new IllegalArgumentException();
}
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
left.accept(visitor);
right.accept(visitor);
JAVA
accept(visitor);
left.traverseTopDown(visitor);
right.traverseTopDown(visitor);
JAVA
left.traverseBottomUp(visitor);
right.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<InfixExpression");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" operator='").append(getXmlStringValue(getOperator(operator))).append("'>\n");
left.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
right.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</InfixExpression>");
JAVA
return ASTNode.INFIX_EXPRESSION;
JAVA
return this.operator;
JAVA
if (getOperator(operator) == null) {
throw new IllegalArgumentException();
}
preValueChange(OPERATOR_PROPERTY);
this.operator = operator;
postValueChange(OPERATOR_PROPERTY);
JAVA
return this.left;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.left;
preReplaceChild(oldChild, expression, LEFT_OPERAND_PROPERTY);
this.left = expression;
postReplaceChild(oldChild, expression, LEFT_OPERAND_PROPERTY);
JAVA
return this.right;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.right;
preReplaceChild(oldChild, expression, RIGHT_OPERAND_PROPERTY);
this.right = expression;
postReplaceChild(oldChild, expression, RIGHT_OPERAND_PROPERTY);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression left = ASTNode.copySubtree(target, getLeft());
final Expression right = ASTNode.copySubtree(target, getRight());
final InfixExpression result = new InfixExpression(this.getStart(), this.getEnd(), target, left, this.getOperator(), right);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == LEFT_OPERAND_PROPERTY) {
if (get) {
return getLeft();
} else {
setLeft((Expression) child);
return null;
}
}
if (property == RIGHT_OPERAND_PROPERTY) {
if (get) {
return getRight();
} else {
setRight((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
if (property == OPERATOR_PROPERTY) {
if (get) {
return getOperator();
} else {
setOperator(value);
return 0;
}
}
// allow default implementation to flag the error
return super.internalGetSetIntProperty(property, get, value);
JAVA
super(start, end, ast);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
// no children
JAVA
accept(visitor);
JAVA
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<InLineHtml");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append("/>");
JAVA
return ASTNode.IN_LINE_HTML;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final ASTNode result = new InLineHtml(this.getStart(), this.getEnd(), target);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(InstanceOfExpression.class, "expression", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(InstanceOfExpression.class, "className", ClassName.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (expr == null || className == null) {
throw new IllegalArgumentException();
}
setExpression(expr);
setClassName(className);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
expression.accept(visitor);
className.accept(visitor);
JAVA
accept(visitor);
expression.traverseTopDown(visitor);
className.traverseTopDown(visitor);
JAVA
expression.traverseBottomUp(visitor);
className.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<InstanceofExpression");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
expression.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
className.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</InstanceofExpression>");
JAVA
return ASTNode.INSTANCE_OF_EXPRESSION;
JAVA
return className;
JAVA
if (classname == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.className;
preReplaceChild(oldChild, classname, CLASSNAME_PROPERTY);
this.className = classname;
postReplaceChild(oldChild, classname, CLASSNAME_PROPERTY);
JAVA
if (property == CLASSNAME_PROPERTY) {
if (get) {
return getClassName();
} else {
setClassName((ClassName) child);
return null;
}
}
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
return expression;
JAVA
return expression;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getExpression());
final ClassName klass = ASTNode.copySubtree(target, getClassName());
final InstanceOfExpression result = new InstanceOfExpression(this.getStart(), this.getEnd(), target, expr, klass);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(InterfaceDeclaration.class, "name", Identifier.class, MANDATORY, NO_CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(InterfaceDeclaration.class, "interfaces", Identifier.class, NO_CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(InterfaceDeclaration.class, "body", Block.class, MANDATORY, CYCLE_RISK)
JAVA
return BODY_PROPERTY;
JAVA
return INTERFACES_PROPERTY;
JAVA
return NAME_PROPERTY;
JAVA
super(start, end, ast, interfaceName, interfaces, body);
JAVA
this(start, end, ast, interfaceName, (Identifier[]) interfaces.toArray(new Identifier[interfaces.size()]), body);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
getName().accept(visitor);
final List interfaes = interfaces();
for (Object node : interfaes) {
ASTNode inter = (ASTNode) node;
inter.accept(visitor);
}
getBody().accept(visitor);
JAVA
accept(visitor);
getName().traverseTopDown(visitor);
final List interfaes = interfaces();
for (Object node : interfaes) {
ASTNode inter = (ASTNode) node;
inter.traverseTopDown(visitor);
}
getBody().traverseTopDown(visitor);
JAVA
getName().traverseBottomUp(visitor);
final List interfaes = interfaces();
for (Object node : interfaes) {
ASTNode inter = (ASTNode) node;
inter.traverseBottomUp(visitor);
}
getBody().traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<InterfaceDeclaration");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("<InterfaceName>\n");
getName().toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("</InterfaceName>\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("<Interfaces>\n");
final List interfaes = interfaces();
for (Object node : interfaes) {
ASTNode inter = (ASTNode) node;
inter.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("</Interfaces>\n");
getBody().toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</InterfaceDeclaration>");
JAVA
return ASTNode.INTERFACE_DECLARATION;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Identifier name = ASTNode.copySubtree(target, getName());
final Block body = ASTNode.copySubtree(target, getBody());
final List interfaces = ASTNode.copySubtrees(target, interfaces());
final InterfaceDeclaration result = new InterfaceDeclaration(getStart(), getEnd(), target, name, interfaces, body);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<VariableBase>(VARIABLES_PROPERTY)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(ListVariable.class, "variables", VariableBase.class, CYCLE_RISK)
JAVA
super(start, end, ast);
if (variables == null) {
throw new IllegalArgumentException();
}
for (VariableBase variableBase : variables) {
this.variables.add(variableBase);
}
JAVA
super(ast);
JAVA
this(start, end, ast, variables == null ? null : (VariableBase[]) variables.toArray(new VariableBase[variables.size()]));
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
for (ASTNode node : this.variables) {
node.accept(visitor);
}
JAVA
accept(visitor);
for (ASTNode node : this.variables) {
node.traverseTopDown(visitor);
}
JAVA
for (ASTNode node : this.variables) {
node.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<List");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
for (ASTNode node : this.variables) {
node.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</List>");
JAVA
return ASTNode.LIST_VARIABLE;
JAVA
return variables.toArray(new VariableBase[this.variables.size()]);
JAVA
return variables;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
if (property == VARIABLES_PROPERTY) {
return variables();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
final List variables = ASTNode.copySubtrees(target, variables());
final ListVariable result = new ListVariable(getStart(), getEnd(), target, variables);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ChildPropertyDescriptor(MethodDeclaration.class, "function", FunctionDeclaration.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(MethodDeclaration.class, "modifier", Integer.class, //$NON-NLS-1$
OPTIONAL)
JAVA
new ChildPropertyDescriptor(Comment.class, "comment", Comment.class, OPTIONAL, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
return MODIFIER_PROPERTY;
JAVA
super(start, end, ast, modifier, shouldComplete);
if (function == null) {
throw new IllegalArgumentException();
}
setFunction(function);
JAVA
this(start, end, ast, modifier, function, false);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
if (comment != null)
comment.accept(visitor);
function.accept(visitor);
JAVA
accept(visitor);
if (comment != null)
comment.traverseTopDown(visitor);
function.traverseTopDown(visitor);
JAVA
function.traverseBottomUp(visitor);
if (comment != null)
comment.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<MethodDeclaration");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" modifier='").append(getModifierString()).append("'>\n");
function.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</MethodDeclaration>");
JAVA
return ASTNode.METHOD_DECLARATION;
JAVA
return function;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.function;
preReplaceChild(oldChild, expression, FUNCTION_PROPERTY);
this.function = expression;
postReplaceChild(oldChild, expression, FUNCTION_PROPERTY);
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.comment;
preReplaceChild(oldChild, expression, COMMENT_PROPERTY);
this.comment = expression;
postReplaceChild(oldChild, expression, COMMENT_PROPERTY);
JAVA
return comment;
JAVA
if (property == FUNCTION_PROPERTY) {
if (get) {
return getFunction();
} else {
setFunction((FunctionDeclaration) child);
return null;
}
}
if (property == COMMENT_PROPERTY) {
if (get) {
return getComment();
} else {
setComment((Comment) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final FunctionDeclaration function = ASTNode.copySubtree(target, getFunction());
final int modifier = getModifier();
final MethodDeclaration result = new MethodDeclaration(getStart(), getEnd(), target, modifier, function, true);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ChildPropertyDescriptor(MethodInvocation.class, "dispatcher", VariableBase.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new ChildPropertyDescriptor(MethodInvocation.class, "method", FunctionInvocation.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
return MethodInvocation.DISPATCHER_PROPERTY;
JAVA
super(ast);
JAVA
super(start, end, ast, dispatcher);
if (method == null) {
throw new IllegalArgumentException();
}
setMethod(method);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
getDispatcher().accept(visitor);
method.accept(visitor);
JAVA
accept(visitor);
getDispatcher().accept(visitor);
method.traverseTopDown(visitor);
JAVA
getDispatcher().traverseBottomUp(visitor);
method.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<MethodInvocation");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Dispatcher>\n");
getDispatcher().toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</Dispatcher>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Property>\n");
method.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</Property>\n");
//$NON-NLS-1$
buffer.append(tab).append("</MethodInvocation>");
JAVA
return ASTNode.METHOD_INVOCATION;
JAVA
return method;
JAVA
return getMethod();
JAVA
if (method == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.method;
preReplaceChild(oldChild, method, METHOD_PROPERTY);
this.method = method;
postReplaceChild(oldChild, method, METHOD_PROPERTY);
JAVA
if (property == METHOD_PROPERTY) {
if (get) {
return getMethod();
} else {
setMethod((FunctionInvocation) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final VariableBase dispatcher = ASTNode.copySubtree(target, getDispatcher());
final FunctionInvocation field = ASTNode.copySubtree(target, getMethod());
final MethodInvocation result = new MethodInvocation(getStart(), getEnd(), target, dispatcher, field);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ParenthesisExpression.class, "expression", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
this(start, end, ast, null);
JAVA
super(ast);
JAVA
super(start, end, ast);
if (expr == null) {
throw new IllegalArgumentException();
}
setExpression(expr);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
if (expression != null) {
expression.accept(visitor);
}
JAVA
accept(visitor);
if (expression != null) {
expression.traverseTopDown(visitor);
}
JAVA
if (expression != null) {
expression.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ParenthesisExpression");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
if (expression != null) {
expression.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</ParenthesisExpression>");
JAVA
return ASTNode.PARENTHESIS_EXPRESSION;
JAVA
return expression;
JAVA
return expression;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getExpression());
final ParenthesisExpression result = new ParenthesisExpression(this.getStart(), this.getEnd(), target, expr);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
0
JAVA
1
JAVA
new ChildPropertyDescriptor(PostfixExpression.class, "variable", VariableBase.class, MANDATORY, CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(PostfixExpression.class, "operator", Integer.class, MANDATORY)
JAVA
super(ast);
JAVA
super(start, end, ast);
if (variable == null) {
throw new IllegalArgumentException();
}
setVariable(variable);
setOperator(operator);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
variable.accept(visitor);
JAVA
accept(visitor);
variable.traverseTopDown(visitor);
JAVA
variable.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<PostfixExpression");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" operator='").append(getOperator(operator)).append("'>\n");
variable.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</PostfixExpression>");
JAVA
switch(operator) {
case OP_DEC:
//$NON-NLS-1$
return "--";
case OP_INC:
//$NON-NLS-1$
return "++";
default:
throw new IllegalArgumentException();
}
JAVA
return ASTNode.POSTFIX_EXPRESSION;
JAVA
return this.operator;
JAVA
return getOperator(this.getOperator());
JAVA
return getOperator(op);
JAVA
if (getOperator(operator) == null) {
throw new IllegalArgumentException();
}
preValueChange(OPERATOR_PROPERTY);
this.operator = operator;
postValueChange(OPERATOR_PROPERTY);
JAVA
if (property == OPERATOR_PROPERTY) {
if (get) {
return getOperator();
} else {
setOperator(value);
return 0;
}
}
// allow default implementation to flag the error
return super.internalGetSetIntProperty(property, get, value);
JAVA
return variable;
JAVA
if (variable == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.variable;
preReplaceChild(oldChild, variable, VARIABLE_PROPERTY);
this.variable = variable;
postReplaceChild(oldChild, variable, VARIABLE_PROPERTY);
JAVA
if (property == VARIABLE_PROPERTY) {
if (get) {
return getVariable();
} else {
setVariable((VariableBase) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final VariableBase variable = ASTNode.copySubtree(target, this.getVariable());
final PostfixExpression result = new PostfixExpression(this.getStart(), this.getEnd(), target, variable, this.getOperator());
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
0
JAVA
1
JAVA
new ChildPropertyDescriptor(PrefixExpression.class, "variable", VariableBase.class, MANDATORY, CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(PrefixExpression.class, "operator", Integer.class, MANDATORY)
JAVA
super(ast);
JAVA
super(start, end, ast);
if (variable == null) {
throw new IllegalArgumentException();
}
setVariable(variable);
setOperator(operator);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
variable.accept(visitor);
JAVA
accept(visitor);
variable.traverseTopDown(visitor);
JAVA
variable.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<PrefixExpression");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" operator='").append(getOperator(operator)).append("'>\n");
variable.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</PrefixExpression>");
JAVA
switch(operator) {
case OP_DEC:
//$NON-NLS-1$
return "--";
case OP_INC:
//$NON-NLS-1$
return "++";
default:
throw new IllegalArgumentException();
}
JAVA
return ASTNode.PREFIX_EXPRESSION;
JAVA
return this.operator;
JAVA
return getOperator(this.getOperator());
JAVA
return getOperator(op);
JAVA
if (getOperator(operator) == null) {
throw new IllegalArgumentException();
}
preValueChange(OPERATOR_PROPERTY);
this.operator = operator;
postValueChange(OPERATOR_PROPERTY);
JAVA
if (property == OPERATOR_PROPERTY) {
if (get) {
return getOperator();
} else {
setOperator(value);
return 0;
}
}
// allow default implementation to flag the error
return super.internalGetSetIntProperty(property, get, value);
JAVA
return variable;
JAVA
if (variable == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.variable;
preReplaceChild(oldChild, variable, VARIABLE_PROPERTY);
this.variable = variable;
postReplaceChild(oldChild, variable, VARIABLE_PROPERTY);
JAVA
if (property == VARIABLE_PROPERTY) {
if (get) {
return getVariable();
} else {
setVariable((VariableBase) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final VariableBase variable = ASTNode.copySubtree(target, this.getVariable());
final PrefixExpression result = new PrefixExpression(this.getStart(), this.getEnd(), target, variable, this.getOperator());
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<Statement>(STATEMENTS_PROPERTY)
JAVA
new ASTNode.NodeList<Comment>(COMMENTS_PROPERTY)
JAVA
new ChildListPropertyDescriptor(Program.class, "statements", Statement.class, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
new ChildListPropertyDescriptor(Program.class, "comments", Comment.class, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
{}
JAVA
super(start, end, ast);
if (statements == null || comments == null) {
throw new IllegalArgumentException();
}
for (Statement statement : statements) {
this.statements.add(statement);
}
for (Object comment : comments) {
this.comments.add((Comment) comment);
}
JAVA
this(start, end, ast, (Statement[]) statements.toArray(new Statement[statements.size()]), commentList);
JAVA
super(ast);
JAVA
return comments;
JAVA
return Collections.unmodifiableCollection(comments);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
for (ASTNode node : this.statements) {
node.accept(visitor);
}
for (ASTNode node : this.comments) {
node.accept(visitor);
}
JAVA
accept(visitor);
for (ASTNode node : this.statements) {
node.traverseTopDown(visitor);
}
for (ASTNode node : this.comments) {
node.traverseTopDown(visitor);
}
JAVA
for (ASTNode node : this.statements) {
node.traverseBottomUp(visitor);
}
for (ASTNode node : this.comments) {
node.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append("<Program");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(">\n").append(TAB).append("<Statements>\n");
for (ASTNode node : this.statements) {
node.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
buffer.append(TAB).append("</Statements>\n").append(TAB).append(//$NON-NLS-1$ //$NON-NLS-2$
"<Comments>\n");
for (ASTNode comment : this.comments) {
comment.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(TAB).append("</Comments>\n").append("</Program>");
JAVA
return ASTNode.PROGRAM;
JAVA
return statements.toArray(new Statement[this.statements.size()]);
JAVA
return this.statements;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
if (lineEndTable == null) {
throw new NullPointerException();
}
// alternate root is *not* considered a structural property
// but we protect them nevertheless
// Disable the check for bug
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=291569
// checkModifiable();
this.lineEndTable = lineEndTable;
JAVA
if (this.lineEndTable == null)
return -2;
final int line = getLineNumber(position);
if (line == -1) {
return -1;
}
if (line == 1) {
if (position >= getStart() + getLength())
return -1;
return position;
}
// length is different from 0
int length = this.lineEndTable.length;
// -1 to for one-based to zero-based conversion.
// -1, again, to get previous line.
final int previousLineOffset = this.lineEndTable[line - 2];
// previousLineOffset + 1 is the first character of the current line
final int offsetForLine = previousLineOffset + 1;
final int currentLineEnd = line == length + 1 ? getStart() + getLength() - 1 : this.lineEndTable[line - 1];
if (offsetForLine > currentLineEnd) {
return -1;
} else {
return position - offsetForLine;
}
JAVA
if (this.lineEndTable == null)
return -2;
int length;
if ((length = this.lineEndTable.length) == 0) {
if (position >= getStart() + getLength()) {
return -1;
}
return 1;
}
int low = 0;
if (position < 0) {
// position illegal
return -1;
}
if (position <= this.lineEndTable[low]) {
// before the first line delimiter
return 1;
}
// assert position > lineEndTable[low+1] && low == 0
int hi = length - 1;
if (position > this.lineEndTable[hi]) {
// position beyond the last line separator
if (position >= getStart() + getLength()) {
// this is beyond the end of the source length
return -1;
} else {
return length + 1;
}
}
// binary search line end table
while (true) {
// reducing measure hi - low
if (low + 1 == hi) {
// position is on line low+1 (line number is low+2)
return low + 2;
}
// assert hi - low >= 2, so average is truly in between
int mid = low + (hi - low) / 2;
// assert 0 <= low < mid < hi <= length - 1
if (position <= this.lineEndTable[mid]) {
// assert lineEndTable[low] < position <= lineEndTable[mid]
// && 0 <= low < mid < hi <= length - 1
hi = mid;
} else {
// position > lineEndTable[mid]
// assert lineEndTable[mid] < position <= lineEndTable[hi]
// && 0 <= low < mid < hi <= length - 1
low = mid;
}
// in both cases, invariant reachieved with reduced measure
}
JAVA
if (this.lineEndTable == null)
return -2;
if (line < 1 || column < 0)
return -1;
int length;
if ((length = this.lineEndTable.length) == 0) {
if (line != 1)
return -1;
return column >= getStart() + getLength() ? -1 : column;
}
if (line == 1) {
final int endOfLine = this.lineEndTable[0];
return column > endOfLine ? -1 : column;
} else if (line > length + 1) {
// greater than the number of lines in the source string.
return -1;
}
// -1 to for one-based to zero-based conversion.
// -1, again, to get previous line.
final int previousLineOffset = this.lineEndTable[line - 2];
// previousLineOffset + 1 is the first character of the current line
final int offsetForLine = previousLineOffset + 1;
final int currentLineEnd = line == length + 1 ? getStart() + getLength() - 1 : this.lineEndTable[line - 1];
if ((offsetForLine + column) > currentLineEnd) {
return -1;
} else {
return offsetForLine + column;
}
JAVA
final List statements = ASTNode.copySubtrees(target, statements());
final List comments = ASTNode.copySubtrees(target, comments());
final Program result = new Program(this.getStart(), this.getEnd(), target, statements, comments);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == STATEMENTS_PROPERTY) {
return statements();
}
if (property == COMMENTS_PROPERTY) {
return comments();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
0
JAVA
1
JAVA
2
JAVA
3
JAVA
new ASTNode.NodeList<Expression>(EXPRESSIONS_PROPERTY)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(Quote.class, "expressions", Expression.class, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new SimplePropertyDescriptor(Block.class, "quoteType", Integer.class, OPTIONAL)
JAVA
super(start, end, ast);
for (Expression expression : expressions) {
this.expressions.add(expression);
}
setQuoteType(type);
JAVA
super(ast);
JAVA
this(start, end, ast, expressions == null ? null : (Expression[]) expressions.toArray(new Expression[expressions.size()]), type);
JAVA
switch(type) {
case QT_QUOTE:
return //$NON-NLS-1$
"quote";
case QT_SINGLE:
return //$NON-NLS-1$
"single";
case QT_HEREDOC:
return //$NON-NLS-1$
"heredoc";
case QT_NOWDOC:
return //$NON-NLS-1$
"nowdoc";
default:
throw new IllegalArgumentException();
}
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
for (ASTNode node : this.expressions) {
node.accept(visitor);
}
JAVA
accept(visitor);
for (ASTNode node : this.expressions) {
node.traverseTopDown(visitor);
}
JAVA
for (ASTNode node : this.expressions) {
node.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<Quote");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" type='").append(getType(quoteType)).append("'>\n");
for (ASTNode node : this.expressions) {
node.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</Quote>");
JAVA
return ASTNode.QUOTE;
JAVA
return expressions.toArray(new Expression[this.expressions.size()]);
JAVA
return this.expressions;
JAVA
if (property == EXPRESSIONS_PROPERTY) {
return expressions();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
return quoteType;
JAVA
if (value != QT_HEREDOC && value != QT_QUOTE && value != QT_SINGLE && value != QT_NOWDOC) {
throw new IllegalArgumentException();
}
preValueChange(QUOTE_TYPE_PROPERTY);
this.quoteType = value;
postValueChange(QUOTE_TYPE_PROPERTY);
JAVA
if (property == QUOTE_TYPE_PROPERTY) {
if (get) {
return getQuoteType();
} else {
setQuoteType(value);
return 0;
}
}
// allow default implementation to flag the error
return super.internalGetSetIntProperty(property, get, value);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final int type = getQuoteType();
final List expressions = ASTNode.copySubtrees(target, expressions());
final Quote result = new Quote(this.getStart(), this.getEnd(), target, expressions, type);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ReturnStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (expression == null) {
throw new IllegalArgumentException();
}
setExpression(expression);
JAVA
this(start, end, ast, (Expression) variable);
JAVA
super(ast);
JAVA
this(start, end, ast, (Expression) classInstanciation);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
expression.accept(visitor);
JAVA
accept(visitor);
expression.traverseTopDown(visitor);
JAVA
expression.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<Reference");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
expression.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</Reference>");
JAVA
return ASTNode.REFERENCE;
JAVA
return expression;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getExpression());
final Reference result = new Reference(this.getStart(), this.getEnd(), target, expr);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ReflectionVariable.class, "name", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new SimplePropertyDescriptor(ReflectionVariable.class, "isDollared", Boolean.class, OPTIONAL)
JAVA
return ReflectionVariable.NAME_PROPERTY;
JAVA
return ReflectionVariable.DOLLARED_PROPERTY;
JAVA
super(start, end, ast, variable);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ReflectionVariable");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
getName().toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</ReflectionVariable>");
JAVA
return ASTNode.REFLECTION_VARIABLE;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getName());
final ReflectionVariable result = new ReflectionVariable(getStart(), getEnd(), target, expr);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ReturnStatement.class, "expression", Expression.class, OPTIONAL, CYCLE_RISK)
JAVA
this(start, end, ast, null);
JAVA
super(ast);
JAVA
super(start, end, ast);
if (expr != null) {
setExpression(expr);
}
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
if (expression != null) {
expression.accept(visitor);
}
JAVA
accept(visitor);
if (expression != null) {
expression.traverseTopDown(visitor);
}
JAVA
if (expression != null) {
expression.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ReturnStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
if (expression != null) {
expression.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</ReturnStatement>");
JAVA
return ASTNode.RETURN_STATEMENT;
JAVA
return expression;
JAVA
return expression;
JAVA
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getExpression());
final ReturnStatement result = new ReturnStatement(this.getStart(), this.getEnd(), target, expr);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
0
JAVA
1
JAVA
2
JAVA
3
JAVA
4
JAVA
5
JAVA
new SimplePropertyDescriptor(Scalar.class, "stringValue", String.class, //$NON-NLS-1$
MANDATORY)
JAVA
new SimplePropertyDescriptor(Scalar.class, "scalarType", Integer.class, //$NON-NLS-1$
MANDATORY)
JAVA
super(start, end, ast);
if (value == null) {
throw new IllegalArgumentException();
}
setScalarType(type);
setStringValue(value);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
JAVA
JAVA
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<Scalar");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" type='").append(getType(scalarType)).append("'");
if (stringValue != null) {
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" value='").append(getXmlStringValue(stringValue)).append("'");
}
//$NON-NLS-1$
buffer.append("/>");
JAVA
switch(type) {
case TYPE_INT:
//$NON-NLS-1$
return "int";
case TYPE_REAL:
//$NON-NLS-1$
return "real";
case TYPE_STRING:
//$NON-NLS-1$
return "string";
case TYPE_UNKNOWN:
//$NON-NLS-1$
return "unknown";
case TYPE_SYSTEM:
//$NON-NLS-1$
return "system";
case TYPE_BIN:
//$NON-NLS-1$
return "bin";
default:
throw new IllegalArgumentException();
}
JAVA
return ASTNode.SCALAR;
JAVA
return scalarType;
JAVA
if (getType(type) == null) {
throw new IllegalArgumentException();
}
preValueChange(TYPE_PROPERTY);
this.scalarType = type;
postValueChange(TYPE_PROPERTY);
JAVA
if (property == TYPE_PROPERTY) {
if (get) {
return getScalarType();
} else {
setScalarType(value);
return 0;
}
}
// allow default implementation to flag the error
return super.internalGetSetIntProperty(property, get, value);
JAVA
return this.stringValue;
JAVA
if (value == null) {
throw new IllegalArgumentException();
}
preValueChange(VALUE_PROPERTY);
this.stringValue = value;
postValueChange(VALUE_PROPERTY);
JAVA
if (property == VALUE_PROPERTY) {
if (get) {
return getStringValue();
} else {
setStringValue((String) value);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetObjectProperty(property, get, value);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Scalar result = new Scalar(this.getStart(), this.getEnd(), target, getStringValue(), getScalarType());
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ChildPropertyDescriptor(StaticConstantAccess.class, "className", Expression.class, MANDATORY, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
new ChildPropertyDescriptor(StaticConstantAccess.class, "parameterType", Identifier.class, MANDATORY, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
return CLASS_NAME_PROPERTY;
JAVA
super(start, end, ast, className);
if (constant == null) {
throw new IllegalArgumentException();
}
setConstant(constant);
JAVA
super(ast);
JAVA
this(start, end, ast, null, name);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
getClassName().accept(visitor);
constant.accept(visitor);
JAVA
accept(visitor);
getClassName().traverseTopDown(visitor);
constant.traverseTopDown(visitor);
JAVA
getClassName().traverseTopDown(visitor);
constant.traverseTopDown(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<StaticConstantAccess");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<ClassName>\n");
getClassName().toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</ClassName>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Constant>\n");
constant.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</Constant>\n");
//$NON-NLS-1$
buffer.append(tab).append("</StaticConstantAccess>");
JAVA
return ASTNode.STATIC_CONSTANT_ACCESS;
JAVA
return constant;
JAVA
if (name == null) {
throw new IllegalArgumentException();
}
// an Assignment may occur inside a Expression - must check cycles
ASTNode oldChild = this.constant;
preReplaceChild(oldChild, name, CONSTANT_PROPERTY);
this.constant = name;
postReplaceChild(oldChild, name, CONSTANT_PROPERTY);
JAVA
if (property == CONSTANT_PROPERTY) {
if (get) {
return getConstant();
} else {
setConstant((Identifier) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
return getConstant();
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression className = ASTNode.copySubtree(target, getClassName());
final Identifier constant = ASTNode.copySubtree(target, getConstant());
final StaticConstantAccess result = new StaticConstantAccess(getStart(), getEnd(), target, className, constant);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ChildPropertyDescriptor(StaticFieldAccess.class, "className", Expression.class, MANDATORY, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
new ChildPropertyDescriptor(StaticFieldAccess.class, "field", Variable.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
return CLASS_NAME_PROPERTY;
JAVA
super(start, end, ast, className);
if (field == null) {
throw new IllegalArgumentException();
}
setField(field);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
getClassName().accept(visitor);
field.accept(visitor);
JAVA
accept(visitor);
getClassName().traverseTopDown(visitor);
field.traverseTopDown(visitor);
JAVA
getClassName().traverseBottomUp(visitor);
field.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<StaticFieldAccess");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<ClassName>\n");
getClassName().toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</ClassName>\n");
field.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</StaticFieldAccess>");
JAVA
return ASTNode.STATIC_FIELD_ACCESS;
JAVA
return field;
JAVA
if (variable == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.field;
preReplaceChild(oldChild, variable, FIELD_PROPERTY);
this.field = variable;
postReplaceChild(oldChild, variable, FIELD_PROPERTY);
JAVA
if (property == FIELD_PROPERTY) {
if (get) {
return getField();
} else {
setField((Variable) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
return getField();
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression name = ASTNode.copySubtree(target, getClassName());
final Variable field = ASTNode.copySubtree(target, getField());
final StaticFieldAccess result = new StaticFieldAccess(getStart(), getEnd(), target, name, field);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ChildPropertyDescriptor(StaticMethodInvocation.class, "className", Expression.class, MANDATORY, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
new ChildPropertyDescriptor(StaticMethodInvocation.class, "method", FunctionInvocation.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
return StaticMethodInvocation.CLASS_NAME_PROPERTY;
JAVA
super(start, end, ast, className);
if (method == null) {
throw new IllegalArgumentException();
}
setMethod(method);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
getClassName().accept(visitor);
method.accept(visitor);
JAVA
accept(visitor);
getClassName().traverseTopDown(visitor);
method.traverseTopDown(visitor);
JAVA
getClassName().traverseBottomUp(visitor);
method.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<StaticMethodInvocation");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<ClassName>\n");
getClassName().toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</ClassName>\n");
method.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</StaticMethodInvocation>");
JAVA
return ASTNode.STATIC_METHOD_INVOCATION;
JAVA
return method;
JAVA
return getMethod();
JAVA
if (method == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.method;
preReplaceChild(oldChild, method, METHOD_PROPERTY);
this.method = method;
postReplaceChild(oldChild, method, METHOD_PROPERTY);
JAVA
if (property == METHOD_PROPERTY) {
if (get) {
return getMethod();
} else {
setMethod((FunctionInvocation) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression className = ASTNode.copySubtree(target, getClassName());
final FunctionInvocation method = ASTNode.copySubtree(target, getMethod());
final StaticMethodInvocation result = new StaticMethodInvocation(getStart(), getEnd(), target, className, method);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<Expression>(EXPRESSIONS_PROPERTY)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(StaticStatement.class, "expressions", Expression.class, CYCLE_RISK)
JAVA
super(start, end, ast);
if (expressions == null) {
throw new IllegalArgumentException();
}
for (Expression expression : expressions) {
this.expressions.add(expression);
}
JAVA
super(ast);
JAVA
this(start, end, ast, expressions == null ? null : (Expression[]) expressions.toArray(new Expression[expressions.size()]));
JAVA
List vars = new LinkedList();
for (Expression node : this.expressions) {
if (node instanceof Variable) {
vars.add(node);
} else {
assert node instanceof Assignment;
Assignment ass = (Assignment) node;
vars.add(ass.getLeftHandSide());
}
}
return (Variable[]) vars.toArray(new Variable[vars.size()]);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
for (ASTNode node : this.expressions) {
node.accept(visitor);
}
JAVA
accept(visitor);
for (ASTNode node : this.expressions) {
node.traverseTopDown(visitor);
}
JAVA
for (ASTNode node : this.expressions) {
node.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<StaticStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
for (ASTNode node : this.expressions) {
node.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</StaticStatement>");
JAVA
return ASTNode.STATIC_STATEMENT;
JAVA
return this.expressions.toArray(new Expression[this.expressions.size()]);
JAVA
return this.expressions;
JAVA
if (property == EXPRESSIONS_PROPERTY) {
return expressions();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final List expressions = ASTNode.copySubtrees(target, this.expressions());
final StaticStatement staticStatementSt = new StaticStatement(this.getStart(), this.getEnd(), target, expressions);
return staticStatementSt;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<Statement>(ACTIONS_PROPERTY)
JAVA
new ChildPropertyDescriptor(SwitchCase.class, "value", Expression.class, OPTIONAL, CYCLE_RISK)
JAVA
new ChildListPropertyDescriptor(SwitchCase.class, "actions", Statement.class, CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(SwitchCase.class, "isDefault", Boolean.class, OPTIONAL)
JAVA
super(start, end, ast);
if (actions == null) {
throw new IllegalArgumentException();
}
if (value != null) {
setValue(value);
}
for (Statement statement : actions) {
this.actions.add(statement);
}
setIsDefault(isDefault);
JAVA
this(start, end, ast, value, actions == null ? null : (Statement[]) actions.toArray(new Statement[actions.size()]), isDefault);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
if (value != null) {
value.accept(visitor);
}
for (ASTNode node : this.actions) {
node.accept(visitor);
}
JAVA
accept(visitor);
if (value != null) {
value.traverseTopDown(visitor);
}
for (ASTNode node : this.actions) {
node.traverseTopDown(visitor);
}
JAVA
if (value != null) {
value.traverseBottomUp(visitor);
}
for (ASTNode node : this.actions) {
node.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<SwitchCase");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" isDefault='").append(isDefault).append("'>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Value>\n");
if (value != null) {
value.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</Value>\n");
for (ASTNode node : this.actions) {
node.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</SwitchCase>");
JAVA
return ASTNode.SWITCH_CASE;
JAVA
return actions.toArray(new Statement[this.actions.size()]);
JAVA
return this.actions;
JAVA
return isDefault;
JAVA
preValueChange(IS_DEFAULT_PROPERTY);
this.isDefault = isDefault;
postValueChange(IS_DEFAULT_PROPERTY);
JAVA
return value;
JAVA
if (isDefault || value == null) {
throw new IllegalArgumentException();
}
// an Assignment may occur inside a Expression - must check cycles
ASTNode oldChild = this.value;
preReplaceChild(oldChild, value, VALUE_PROPERTY);
this.value = value;
postReplaceChild(oldChild, value, VALUE_PROPERTY);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
if (property == IS_DEFAULT_PROPERTY) {
if (get) {
return isDefault();
} else {
setIsDefault(value);
return false;
}
}
// allow default implementation to flag the error
return super.internalGetSetBooleanProperty(property, get, value);
JAVA
if (property == VALUE_PROPERTY) {
if (get) {
return getValue();
} else {
setValue((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
if (property == ACTIONS_PROPERTY) {
return actions();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
final boolean isDefault = isDefault();
final List actions = ASTNode.copySubtrees(target, actions());
final Expression value = ASTNode.copySubtree(target, getValue());
final SwitchCase result = new SwitchCase(getStart(), getEnd(), target, value, actions, isDefault);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(SwitchStatement.class, "expression", Expression.class, MANDATORY, NO_CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(SwitchStatement.class, "body", Statement.class, MANDATORY, CYCLE_RISK)
JAVA
super(ast);
JAVA
super(start, end, ast);
if (expression == null || body == null) {
throw new IllegalArgumentException();
}
setExpression(expression);
setBody(body);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
expression.accept(visitor);
body.accept(visitor);
JAVA
accept(visitor);
expression.traverseTopDown(visitor);
body.traverseTopDown(visitor);
JAVA
expression.traverseBottomUp(visitor);
body.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<SwitchStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Expression>\n");
expression.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</Expression>\n");
body.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</SwitchStatement>");
JAVA
return ASTNode.SWITCH_STATEMENT;
JAVA
return expression;
JAVA
return expression;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
return body;
JAVA
return this.body;
JAVA
if (body == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.body;
preReplaceChild(oldChild, body, BODY_PROPERTY);
this.body = body;
postReplaceChild(oldChild, body, BODY_PROPERTY);
JAVA
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
if (property == BODY_PROPERTY) {
if (get) {
return getBody();
} else {
setBody((Block) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getExpression());
final Block body = ASTNode.copySubtree(target, getBody());
final SwitchStatement result = new SwitchStatement(this.getStart(), this.getEnd(), target, expr, body);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(ThrowStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (expr == null) {
throw new IllegalArgumentException();
}
setExpression(expr);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
expression.accept(visitor);
JAVA
accept(visitor);
expression.traverseTopDown(visitor);
JAVA
expression.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ThrowStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
expression.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</ThrowStatement>");
JAVA
return ASTNode.THROW_STATEMENT;
JAVA
return expression;
JAVA
return expression;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getExpression());
final ThrowStatement result = new ThrowStatement(this.getStart(), this.getEnd(), target, expr);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<CatchClause>(CATCH_CLAUSES_PROPERTY)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(TryStatement.class, "tryStatement", Block.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(TryStatement.class, "catchClauses", CatchClause.class, CYCLE_RISK)
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
super(start, end, ast);
if (tryStatement == null || catchClauses == null) {
throw new IllegalArgumentException();
}
setBody(tryStatement);
for (int i = 0; i < catchClauses.length; i++) {
this.catchClauses.add(catchClauses[i]);
}
JAVA
this(start, end, ast, tryStatement, catchClauses == null ? null : (CatchClause[]) catchClauses.toArray(new CatchClause[catchClauses.size()]));
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
tryStatement.accept(visitor);
for (ASTNode catchClause : this.catchClauses) {
catchClause.accept(visitor);
}
JAVA
accept(visitor);
tryStatement.traverseTopDown(visitor);
for (ASTNode catchClause : this.catchClauses) {
catchClause.traverseTopDown(visitor);
}
JAVA
tryStatement.traverseBottomUp(visitor);
for (ASTNode catchClause : this.catchClauses) {
catchClause.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<TryStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
tryStatement.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
for (ASTNode catchClause : this.catchClauses) {
catchClause.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</TryStatement>");
JAVA
return ASTNode.TRY_STATEMENT;
JAVA
return catchClauses.toArray(new CatchClause[catchClauses.size()]);
JAVA
return tryStatement;
JAVA
return this.tryStatement;
JAVA
if (body == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.tryStatement;
preReplaceChild(oldChild, body, BODY_PROPERTY);
this.tryStatement = body;
postReplaceChild(oldChild, body, BODY_PROPERTY);
JAVA
return this.catchClauses;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
Block body = ASTNode.copySubtree(target, getBody());
final List catchs = ASTNode.copySubtrees(target, this.catchClauses);
final TryStatement result = new TryStatement(this.getStart(), this.getEnd(), target, body, catchs);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == BODY_PROPERTY) {
if (get) {
return getBody();
} else {
setBody((Block) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
if (property == CATCH_CLAUSES_PROPERTY) {
return catchClauses();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
0
JAVA
1
JAVA
2
JAVA
3
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(UnaryOperation.class, "expression", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new SimplePropertyDescriptor(UnaryOperation.class, "operator", Integer.class, MANDATORY)
JAVA
super(start, end, ast);
if (expr == null) {
throw new IllegalArgumentException();
}
setExpression(expr);
setOperator(operator);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
expression.accept(visitor);
JAVA
accept(visitor);
expression.traverseTopDown(visitor);
JAVA
expression.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<UnaryOperation");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" operator='").append(getOperator(operator)).append("'>\n");
expression.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</UnaryOperation>");
JAVA
switch(operator) {
case OP_PLUS:
//$NON-NLS-1$
return "+";
case OP_MINUS:
//$NON-NLS-1$
return "-";
case OP_NOT:
//$NON-NLS-1$
return "!";
case OP_TILDA:
//$NON-NLS-1$
return "~";
default:
throw new IllegalArgumentException();
}
JAVA
return ASTNode.UNARY_OPERATION;
JAVA
return expression;
JAVA
return expression;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.expression;
preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
this.expression = expression;
postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY);
JAVA
if (property == EXPRESSION_PROPERTY) {
if (get) {
return getExpression();
} else {
setExpression((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
return operator;
JAVA
return getOperator(this.getOperator());
JAVA
return getOperator(op);
JAVA
if (getOperator(value) == null) {
throw new IllegalArgumentException();
}
preValueChange(OPERATOR_PROPERTY);
this.operator = value;
postValueChange(OPERATOR_PROPERTY);
JAVA
if (property == OPERATOR_PROPERTY) {
if (get) {
return getOperator();
} else {
setOperator(value);
return 0;
}
}
// allow default implementation to flag the error
return super.internalGetSetIntProperty(property, get, value);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expression = ASTNode.copySubtree(target, this.getExpression());
final UnaryOperation result = new UnaryOperation(this.getStart(), this.getEnd(), target, expression, this.getOperator());
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(WhileStatement.class, "condition", Expression.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(WhileStatement.class, "body", Statement.class, MANDATORY, CYCLE_RISK)
JAVA
super(ast);
JAVA
super(start, end, ast);
if (condition == null || action == null) {
throw new IllegalArgumentException();
}
setCondition(condition);
setBody(action);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
condition.accept(visitor);
body.accept(visitor);
JAVA
accept(visitor);
condition.traverseTopDown(visitor);
body.traverseTopDown(visitor);
JAVA
condition.traverseBottomUp(visitor);
body.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<WhileStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Condition>\n");
condition.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</Condition>\n");
body.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</WhileStatement>");
JAVA
return ASTNode.WHILE_STATEMENT;
JAVA
return body;
JAVA
return this.body;
JAVA
return this.condition;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.condition;
preReplaceChild(oldChild, expression, CONDITION_PROPERTY);
this.condition = expression;
postReplaceChild(oldChild, expression, CONDITION_PROPERTY);
JAVA
if (body == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.body;
preReplaceChild(oldChild, body, BODY_PROPERTY);
this.body = body;
postReplaceChild(oldChild, body, BODY_PROPERTY);
JAVA
if (property == CONDITION_PROPERTY) {
if (get) {
return getCondition();
} else {
setCondition((Expression) child);
return null;
}
}
if (property == BODY_PROPERTY) {
if (get) {
return getBody();
} else {
setBody((Statement) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Statement body = ASTNode.copySubtree(target, getBody());
final Expression condition = ASTNode.copySubtree(target, getCondition());
final WhileStatement result = new WhileStatement(this.getStart(), this.getEnd(), target, condition, body);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<Identifier>(ELEMENTS_PROPERTY)
JAVA
new ChildListPropertyDescriptor(NamespaceName.class, "segments", Identifier.class, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(UseStatementPart.class, "global", Boolean.class, //$NON-NLS-1$
MANDATORY)
JAVA
new SimplePropertyDescriptor(UseStatementPart.class, "current", Boolean.class, //$NON-NLS-1$
MANDATORY)
JAVA
super(ast);
JAVA
super(start, end, ast, buildName(segments, global, current));
if (segments == null) {
throw new IllegalArgumentException();
}
for (Identifier name : segments) {
this.segments.add(name);
}
this.global = global;
this.current = current;
JAVA
super(start, end, ast, buildName((Identifier[]) segments.toArray(new Identifier[segments.size()]), global, current));
if (segments == null) {
throw new IllegalArgumentException();
}
Iterator<Identifier> it = segments.iterator();
while (it.hasNext()) {
this.segments.add(it.next());
}
this.global = global;
this.current = current;
JAVA
StringBuilder buf = new StringBuilder();
if (global) {
buf.append('\\');
} else if (current) {
buf.append("namespace\\");
}
for (int i = 0; i < segments.length; ++i) {
if (i > 0) {
buf.append('\\');
}
buf.append(segments[i].getName());
}
return buf.toString();
JAVA
for (ASTNode node : this.segments) {
node.accept(visitor);
}
JAVA
accept(visitor);
for (ASTNode node : this.segments) {
node.traverseTopDown(visitor);
}
JAVA
for (ASTNode node : this.segments) {
node.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
buffer.append(tab).append("<NamespaceName");
appendInterval(buffer);
buffer.append(" global='").append(global).append('\'');
//$NON-NLS-1$
buffer.append(" current='").append(current).append('\'');
//$NON-NLS-1$
buffer.append(">\n");
for (ASTNode node : this.segments) {
node.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</NamespaceName>");
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
return ASTNode.NAMESPACE_NAME;
JAVA
return global;
JAVA
preValueChange(GLOBAL_PROPERTY);
this.global = global;
postValueChange(GLOBAL_PROPERTY);
JAVA
return current;
JAVA
preValueChange(CURRENT_PROPERTY);
this.current = current;
postValueChange(CURRENT_PROPERTY);
JAVA
return this.segments;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final List segments = ASTNode.copySubtrees(target, segments());
final boolean global = isGlobal();
final boolean current = isCurrent();
final NamespaceName result = new NamespaceName(this.getStart(), this.getEnd(), target, segments, global, current);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == GLOBAL_PROPERTY) {
if (get) {
return isGlobal();
} else {
setGlobal(value);
return false;
}
}
if (property == CURRENT_PROPERTY) {
if (get) {
return isCurrent();
} else {
setCurrent(value);
return false;
}
}
return super.internalGetSetBooleanProperty(property, get, value);
JAVA
if (property == ELEMENTS_PROPERTY) {
return segments();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
true
JAVA
new ChildPropertyDescriptor(NamespaceDeclaration.class, "name", NamespaceName.class, OPTIONAL, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
new ChildPropertyDescriptor(NamespaceDeclaration.class, "body", Block.class, OPTIONAL, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(NamespaceDeclaration.class, "bracketed", Boolean.class, //$NON-NLS-1$
MANDATORY)
JAVA
super(ast);
JAVA
super(start, end, ast);
if (!bracketed && name == null) {
throw new IllegalArgumentException("Namespace name must not be null in an un-bracketed statement");
}
this.bracketed = bracketed;
if (body == null) {
body = new Block(end + 1, end + 1, ast, new ArrayList(), false);
}
body.setParent(this, BODY_PROPERTY);
if (name != null) {
name.setParent(this, NAME_PROPERTY);
}
this.name = name;
this.body = body;
JAVA
return bracketed;
JAVA
preValueChange(BRACKETED_PROPERTY);
this.bracketed = bracketed;
postValueChange(BRACKETED_PROPERTY);
JAVA
Block body = getBody();
body.statements().add(statement);
int statementEnd = statement.getEnd();
int bodyStart = body.getStart();
body.setSourceRange(bodyStart, statementEnd - bodyStart + 1);
int namespaceStart = getStart();
setSourceRange(namespaceStart, statementEnd - namespaceStart);
JAVA
return body;
JAVA
// an Assignment may occur inside a Expression - must check cycles
ASTNode oldChild = this.body;
preReplaceChild(oldChild, block, BODY_PROPERTY);
this.body = block;
postReplaceChild(oldChild, block, BODY_PROPERTY);
JAVA
return name;
JAVA
// an Assignment may occur inside a Expression - must check cycles
ASTNode oldChild = this.name;
preReplaceChild(oldChild, name, NAME_PROPERTY);
this.name = name;
postReplaceChild(oldChild, name, NAME_PROPERTY);
JAVA
NamespaceName name = getName();
if (name != null) {
name.accept(visitor);
}
Block body = getBody();
body.accept(visitor);
JAVA
accept(visitor);
NamespaceName name = getName();
if (name != null) {
name.accept(visitor);
}
Block body = getBody();
body.accept(visitor);
JAVA
NamespaceName name = getName();
if (name != null) {
name.accept(visitor);
}
Block body = getBody();
body.accept(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<NamespaceDeclaration");
appendInterval(buffer);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" isBracketed='").append(bracketed).append("'>\n");
NamespaceName name = getName();
if (name != null) {
name.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
Block body = getBody();
body.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</NamespaceDeclaration>");
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
return ASTNode.NAMESPACE;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final NamespaceName name = ASTNode.copySubtree(target, getName());
final Block body = ASTNode.copySubtree(target, getBody());
final boolean bracketed = isBracketed();
final NamespaceDeclaration result = new NamespaceDeclaration(this.getStart(), this.getEnd(), target, name, body, bracketed);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == BRACKETED_PROPERTY) {
if (get) {
return isBracketed();
} else {
setBracketed(value);
return false;
}
}
return super.internalGetSetBooleanProperty(property, get, value);
JAVA
if (property == BODY_PROPERTY) {
if (get) {
return getBody();
} else {
setBody((Block) child);
return null;
}
}
if (property == NAME_PROPERTY) {
if (get) {
return getName();
} else {
setName((NamespaceName) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(UseStatementPart.class, "name", NamespaceName.class, MANDATORY, CYCLE_RISK)
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(UseStatementPart.class, "alias", Expression.class, OPTIONAL, CYCLE_RISK)
JAVA
super(ast);
JAVA
super(start, end, ast);
if (name == null) {
throw new IllegalArgumentException();
}
setName(name);
if (alias != null) {
setAlias(alias);
}
JAVA
name.accept(visitor);
if (alias != null) {
alias.accept(visitor);
}
JAVA
accept(visitor);
name.traverseTopDown(visitor);
if (alias != null) {
alias.traverseTopDown(visitor);
}
JAVA
name.traverseBottomUp(visitor);
if (alias != null) {
alias.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<UseStatementPart");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Name>\n");
name.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</Name>\n");
if (alias != null) {
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<Alias>\n");
alias.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(TAB).append(tab).append("</Alias>\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</UseStatementPart>");
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
return ASTNode.USE_STATEMENT_PART;
JAVA
return name;
JAVA
if (name == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.name;
preReplaceChild(oldChild, name, NAME_PROPERTY);
this.name = name;
postReplaceChild(oldChild, name, NAME_PROPERTY);
JAVA
return this.alias;
JAVA
ASTNode oldChild = this.alias;
preReplaceChild(oldChild, alias, ALIAS_PROPERTY);
this.alias = alias;
postReplaceChild(oldChild, alias, ALIAS_PROPERTY);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final NamespaceName name = ASTNode.copySubtree(target, getName());
final Identifier alias = ASTNode.copySubtree(target, getAlias());
final UseStatementPart result = new UseStatementPart(this.getStart(), this.getEnd(), target, name, alias);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == NAME_PROPERTY) {
if (get) {
return getName();
} else {
setName((NamespaceName) child);
return null;
}
}
if (property == ALIAS_PROPERTY) {
if (get) {
return getAlias();
} else {
setAlias((Identifier) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
new ASTNode.NodeList<UseStatementPart>(PARTS_PROPERTY)
JAVA
//$NON-NLS-1$
new ChildListPropertyDescriptor(UseStatement.class, "parts", UseStatementPart.class, NO_CYCLE_RISK)
JAVA
super(ast);
JAVA
super(start, end, ast);
if (parts == null || parts.size() == 0) {
throw new IllegalArgumentException();
}
Iterator<UseStatementPart> it = parts.iterator();
while (it.hasNext()) {
this.parts.add(it.next());
}
JAVA
super(start, end, ast);
if (parts == null || parts.length == 0) {
throw new IllegalArgumentException();
}
for (UseStatementPart part : parts) {
this.parts.add(part);
}
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
for (ASTNode node : this.parts) {
node.accept(visitor);
}
JAVA
accept(visitor);
for (ASTNode node : this.parts) {
node.traverseTopDown(visitor);
}
JAVA
for (ASTNode node : this.parts) {
node.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<UseStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
for (UseStatementPart part : this.parts) {
part.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</UseStatement>");
JAVA
return ASTNode.USE_STATEMENT;
JAVA
return this.parts;
JAVA
if (property == PARTS_PROPERTY) {
return parts();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final List parts = ASTNode.copySubtrees(target, parts());
final UseStatement result = new UseStatement(getStart(), getEnd(), target, parts);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(GotoLabel.class, "name", Identifier.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (name == null) {
throw new IllegalArgumentException();
}
setName(name);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
name.accept(visitor);
JAVA
accept(visitor);
name.traverseTopDown(visitor);
JAVA
name.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<GotoLabel");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
name.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</GotoLabel>");
JAVA
return ASTNode.GOTO_LABEL;
JAVA
return this.name;
JAVA
if (name == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.name;
preReplaceChild(oldChild, name, NAME_PROPERTY);
this.name = name;
postReplaceChild(oldChild, name, NAME_PROPERTY);
JAVA
if (property == NAME_PROPERTY) {
if (get) {
return getName();
} else {
setName((Identifier) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Identifier name = ASTNode.copySubtree(target, getName());
final GotoLabel result = new GotoLabel(this.getStart(), this.getEnd(), target, name);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
//$NON-NLS-1$
new ChildPropertyDescriptor(GotoStatement.class, "label", Identifier.class, MANDATORY, CYCLE_RISK)
JAVA
super(start, end, ast);
if (label == null) {
throw new IllegalArgumentException();
}
setLabel(label);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
label.accept(visitor);
JAVA
accept(visitor);
label.traverseTopDown(visitor);
JAVA
label.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<GotoStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
label.toString(buffer, TAB + tab);
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append("\n").append(tab).append("</GotoStatement>");
JAVA
return ASTNode.GOTO_STATEMENT;
JAVA
return this.label;
JAVA
if (label == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.label;
preReplaceChild(oldChild, label, LABEL_PROPERTY);
this.label = label;
postReplaceChild(oldChild, label, LABEL_PROPERTY);
JAVA
if (property == LABEL_PROPERTY) {
if (get) {
return getLabel();
} else {
setLabel((Identifier) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Identifier label = ASTNode.copySubtree(target, getLabel());
final GotoStatement result = new GotoStatement(this.getStart(), this.getEnd(), target, label);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<FormalParameter>(FORMAL_PARAMETERS_PROPERTY)
JAVA
new ASTNode.NodeList<Expression>(LEXICAL_VARIABLES_PROPERTY)
JAVA
new SimplePropertyDescriptor(LambdaFunctionDeclaration.class, "isReference", Boolean.class, //$NON-NLS-1$
OPTIONAL)
JAVA
new SimplePropertyDescriptor(LambdaFunctionDeclaration.class, "isStatic", Boolean.class, //$NON-NLS-1$
OPTIONAL)
JAVA
new ChildListPropertyDescriptor(LambdaFunctionDeclaration.class, "formalParameters", FormalParameter.class, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
new ChildListPropertyDescriptor(LambdaFunctionDeclaration.class, "lexicalVariables", Expression.class, //$NON-NLS-1$
NO_CYCLE_RISK)
JAVA
new ChildPropertyDescriptor(LambdaFunctionDeclaration.class, "body", Block.class, OPTIONAL, //$NON-NLS-1$
CYCLE_RISK)
JAVA
this(start, end, ast, formalParameters, lexicalVars, body, isReference, false, -1);
JAVA
super(start, end, ast);
if (formalParameters == null) {
throw new IllegalArgumentException();
}
setIsReference(isReference);
Iterator<FormalParameter> paramIt = formalParameters.iterator();
while (paramIt.hasNext()) {
this.formalParameters.add(paramIt.next());
}
if (lexicalVars != null) {
Iterator<Expression> varsIt = lexicalVars.iterator();
while (varsIt.hasNext()) {
this.lexicalVariables.add(varsIt.next());
}
}
if (body != null) {
setBody(body);
}
setStatic(isStatic);
this.staticStart = staticStart;
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
for (ASTNode node : this.formalParameters) {
node.accept(visitor);
}
for (ASTNode node : this.lexicalVariables) {
node.accept(visitor);
}
if (body != null) {
body.accept(visitor);
}
JAVA
accept(visitor);
for (ASTNode node : this.formalParameters) {
node.traverseTopDown(visitor);
}
for (ASTNode node : this.lexicalVariables) {
node.accept(visitor);
}
if (body != null) {
body.traverseTopDown(visitor);
}
JAVA
for (ASTNode node : this.formalParameters) {
node.traverseBottomUp(visitor);
}
for (ASTNode node : this.lexicalVariables) {
node.accept(visitor);
}
if (body != null) {
body.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<LambdaFunctionDeclaration");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(" isReference='").append(isReference);
if (isStatic) {
//$NON-NLS-1$
buffer.append(" isStatic='").append(isStatic);
}
//$NON-NLS-1$
buffer.append("'>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<FormalParameters>\n");
for (ASTNode node : this.formalParameters) {
node.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</FormalParameters>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<LexicalVariables>\n");
for (ASTNode node : this.lexicalVariables) {
node.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</LexicalVariables>\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<FunctionBody>\n");
if (body != null) {
body.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</FunctionBody>\n");
//$NON-NLS-1$
buffer.append(tab).append("</LambdaFunctionDeclaration>");
JAVA
return ASTNode.LAMBDA_FUNCTION_DECLARATION;
JAVA
return body;
JAVA
if (body == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.body;
preReplaceChild(oldChild, body, BODY_PROPERTY);
this.body = body;
postReplaceChild(oldChild, body, BODY_PROPERTY);
JAVA
return this.formalParameters;
JAVA
return this.lexicalVariables;
JAVA
return isReference;
JAVA
preValueChange(IS_REFERENCE_PROPERTY);
this.isReference = value;
postValueChange(IS_REFERENCE_PROPERTY);
JAVA
return isStatic;
JAVA
preValueChange(IS_STATIC);
this.isStatic = isStatic;
postValueChange(IS_STATIC);
JAVA
if (property == IS_REFERENCE_PROPERTY) {
if (get) {
return isReference();
} else {
setIsReference(value);
return false;
}
} else if (property == IS_STATIC) {
if (get) {
return isStatic();
} else {
setStatic(value);
return false;
}
}
// allow default implementation to flag the error
return super.internalGetSetBooleanProperty(property, get, value);
JAVA
if (property == BODY_PROPERTY) {
if (get) {
return getBody();
} else {
setBody((Block) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
if (property == FORMAL_PARAMETERS_PROPERTY) {
return formalParameters();
}
if (property == LEXICAL_VARIABLES_PROPERTY) {
return lexicalVariables();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Block body = ASTNode.copySubtree(target, getBody());
final List formalParams = ASTNode.copySubtrees(target, formalParameters());
final List lexicalVars = ASTNode.copySubtrees(target, lexicalVariables());
final boolean isRef = isReference();
final LambdaFunctionDeclaration result = new LambdaFunctionDeclaration(getStart(), getEnd(), target, formalParams, lexicalVars, body, isRef, isStatic(), this.staticStart);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
new ASTNode.NodeList<DereferenceNode>(DEREFERENCES_PROPERTY)
JAVA
new ChildListPropertyDescriptor(PHPArrayDereferenceList.class, "dereferences", DereferenceNode.class, //$NON-NLS-1$
CYCLE_RISK)
JAVA
super(ast);
JAVA
super(ast);
if (dereferences != null) {
this.dereferences.addAll(dereferences);
}
JAVA
for (ASTNode node : dereferences) {
node.accept(visitor);
}
JAVA
for (ASTNode node : dereferences) {
node.traverseTopDown(visitor);
}
JAVA
for (ASTNode node : dereferences) {
node.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<PHPArrayDereferenceList");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
for (ASTNode node : dereferences) {
node.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</PHPArrayDereferenceList>");
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
return matcher.match(this, other);
JAVA
// TODO Auto-generated method stub
return 0;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
final List<DereferenceNode> dereferences = ASTNode.copySubtrees(target, getDereferences());
final PHPArrayDereferenceList result = new PHPArrayDereferenceList(target, dereferences);
return result;
JAVA
return dereferences;
JAVA
if (property == DEREFERENCES_PROPERTY) {
return getDereferences();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
new LinkedList<VariableBase>()
JAVA
new ChildPropertyDescriptor(ChainingInstanceCall.class, "arrayDereferenceList", PHPArrayDereferenceList.class, OPTIONAL, //$NON-NLS-1$
CYCLE_RISK)
JAVA
super(start, end, ast);
this.arrayDereferenceList = arrayDereferenceList;
if (chainingMethodOrProperty != null) {
this.chainingMethodOrProperty.addAll(chainingMethodOrProperty);
}
JAVA
super(ast);
setArrayDereferenceList(arrayDereferenceList);
if (chainingMethodOrProperty != null) {
this.chainingMethodOrProperty.addAll(chainingMethodOrProperty);
}
JAVA
return chainingMethodOrProperty;
JAVA
this.chainingMethodOrProperty = chainingMethodOrProperty;
JAVA
ASTNode oldChild = this.arrayDereferenceList;
preReplaceChild(oldChild, arrayDereferenceList, ARRAY_DEREFERENCE_LIST);
this.arrayDereferenceList = arrayDereferenceList;
postReplaceChild(oldChild, arrayDereferenceList, ARRAY_DEREFERENCE_LIST);
JAVA
return arrayDereferenceList;
JAVA
return ASTNodeKinds.USE_STATEMENT;
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
if (arrayDereferenceList != null) {
arrayDereferenceList.accept(visitor);
}
if (chainingMethodOrProperty != null) {
for (VariableBase variableBase : chainingMethodOrProperty) {
variableBase.accept(visitor);
}
}
JAVA
accept(visitor);
if (arrayDereferenceList != null) {
arrayDereferenceList.traverseTopDown(visitor);
}
if (chainingMethodOrProperty != null) {
for (VariableBase variableBase : chainingMethodOrProperty) {
variableBase.traverseTopDown(visitor);
}
}
JAVA
if (arrayDereferenceList != null) {
arrayDereferenceList.traverseBottomUp(visitor);
}
if (chainingMethodOrProperty != null) {
for (VariableBase variableBase : chainingMethodOrProperty) {
variableBase.traverseBottomUp(visitor);
}
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<ChainingInstanceCall");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
// buffer.append(TAB).append(tab).append("<arrayDereferenceList>\n"); //$NON-NLS-1$
if (arrayDereferenceList != null) {
buffer.append(TAB).append(tab).append("<PHPArrayDereferenceList>\n");
arrayDereferenceList.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</PHPArrayDereferenceList>");
}
if (chainingMethodOrProperty != null) {
buffer.append(TAB).append(tab).append("<ChainingMethodOrProperty>\n");
for (VariableBase variableBase : chainingMethodOrProperty) {
variableBase.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append(//$NON-NLS-1$
"\n");
}
buffer.append(TAB).append(tab).append("</ChainingMethodOrProperty>");
}
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</ChainingInstanceCall>");
JAVA
return ASTNode.FUNCTION_NAME;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
PHPArrayDereferenceList arrayDereferenceList = ASTNode.copySubtree(target, getArrayDereferenceList());
final List<VariableBase> chainingMethodOrProperty = ASTNode.copySubtrees(target, getChainingMethodOrProperty());
final ChainingInstanceCall result = new ChainingInstanceCall(this.getStart(), this.getEnd(), target, arrayDereferenceList, chainingMethodOrProperty);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
if (property == ARRAY_DEREFERENCE_LIST) {
if (get) {
return getArrayDereferenceList();
} else {
setArrayDereferenceList((PHPArrayDereferenceList) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
new ChildPropertyDescriptor(DereferenceNode.class, "name", Expression.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
super(start, end, ast);
if (indexName == null) {
throw new IllegalArgumentException();
}
setName(indexName);
JAVA
super(ast);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
name.accept(visitor);
JAVA
accept(visitor);
name.traverseTopDown(visitor);
JAVA
name.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<DereferenceNode");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
name.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</DereferenceNode>");
JAVA
return 0;
JAVA
return this.name;
JAVA
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.name;
preReplaceChild(oldChild, expression, NAME_PROPERTY);
this.name = expression;
postReplaceChild(oldChild, expression, NAME_PROPERTY);
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
final Expression expr = ASTNode.copySubtree(target, getName());
final DereferenceNode result = new DereferenceNode(this.getStart(), this.getEnd(), target, expr);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == NAME_PROPERTY) {
if (get) {
return getName();
} else {
setName((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
new ChildPropertyDescriptor(FullyQualifiedTraitMethodReference.class, "className", NamespaceName.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new ChildPropertyDescriptor(FullyQualifiedTraitMethodReference.class, "functionName", Identifier.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
super(start, end, ast);
setClassName(className);
setFunctionName(functionName);
JAVA
super(ast);
JAVA
return className;
JAVA
if (className == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.className;
preReplaceChild(oldChild, className, CLASS_NAME);
this.className = className;
postReplaceChild(oldChild, className, CLASS_NAME);
JAVA
return functionName;
JAVA
ASTNode oldChild = this.functionName;
preReplaceChild(oldChild, functionName, FUNCTION_NAME);
this.functionName = functionName;
postReplaceChild(oldChild, functionName, FUNCTION_NAME);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
className.accept(visitor);
functionName.accept(visitor);
JAVA
accept(visitor);
className.traverseTopDown(visitor);
functionName.traverseTopDown(visitor);
JAVA
className.traverseBottomUp(visitor);
functionName.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<FunctionName");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(" functionName='").append(functionName.getName()).append(//$NON-NLS-1$
"'");
//$NON-NLS-1$
buffer.append(">\n");
className.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</FunctionName>");
JAVA
return ASTNode.FULLY_QUALIFIED_TRAIT_METHOD_REFERENCE;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
NamespaceName className = ASTNode.copySubtree(target, getClassName());
final FullyQualifiedTraitMethodReference result = new FullyQualifiedTraitMethodReference(this.getStart(), this.getEnd(), target, className, functionName);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == CLASS_NAME) {
if (get) {
return getClassName();
} else {
setClassName((NamespaceName) child);
return null;
}
} else if (property == FUNCTION_NAME) {
if (get) {
return getFunctionName();
} else {
setFunctionName((Identifier) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
new ChildPropertyDescriptor(TraitAlias.class, "traitMethod", Expression.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new SimplePropertyDescriptor(TraitAlias.class, "modifier", Integer.class, //$NON-NLS-1$
OPTIONAL)
JAVA
new ChildPropertyDescriptor(TraitAlias.class, "functionName", Identifier.class, OPTIONAL, //$NON-NLS-1$
CYCLE_RISK)
JAVA
super(start, end, ast);
setTraitMethod(traitMethod);
setModifier(modifier);
setModifierOffset(modifierOffset);
setFunctionName(functionName);
JAVA
super(ast);
JAVA
return traitMethod;
JAVA
if (traitMethod == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.traitMethod;
preReplaceChild(oldChild, traitMethod, TRAIT_METHOD);
this.traitMethod = traitMethod;
postReplaceChild(oldChild, traitMethod, TRAIT_METHOD);
JAVA
return modifier;
JAVA
preValueChange(MODIFIER);
this.modifier = modifier;
postValueChange(MODIFIER);
JAVA
return modifierOffset;
JAVA
this.modifierOffset = modifierOffset;
JAVA
return functionName;
JAVA
ASTNode oldChild = this.functionName;
preReplaceChild(oldChild, functionName, FUNCTION_NAME);
this.functionName = functionName;
postReplaceChild(oldChild, functionName, FUNCTION_NAME);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
traitMethod.accept(visitor);
if (functionName != null) {
functionName.accept(visitor);
}
JAVA
accept(visitor);
traitMethod.traverseTopDown(visitor);
if (functionName != null) {
functionName.traverseTopDown(visitor);
}
JAVA
traitMethod.traverseBottomUp(visitor);
if (functionName != null) {
functionName.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<TraitAlias");
appendInterval(buffer);
if (functionName != null) {
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" functionName='").append(functionName.getName()).append("' ");
}
//$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" modifier='").append(PHPFlags.toString(modifier)).append("'>\n");
traitMethod.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</TraitAlias>");
JAVA
return ASTNode.TRAIT_ALIAS;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
Expression traitMethod = ASTNode.copySubtree(target, getTraitMethod());
Identifier functionName = ASTNode.copySubtree(target, getFunctionName());
final TraitAlias result = new TraitAlias(this.getStart(), this.getEnd(), target, traitMethod, modifier, modifierOffset, functionName);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == MODIFIER) {
if (get) {
return getModifier();
} else {
int oldValue = getModifier();
setModifier(value);
return oldValue;
}
}
return super.internalGetSetIntProperty(property, get, value);
JAVA
if (property == TRAIT_METHOD) {
if (get) {
return getTraitMethod();
} else {
setTraitMethod((Expression) child);
return null;
}
} else if (property == FUNCTION_NAME) {
if (get) {
return getFunctionName();
} else {
setFunctionName((Identifier) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
super(start, end, ast, alias);
this.alias = alias;
JAVA
super(ast);
JAVA
return alias;
JAVA
super.setExp(alias);
this.alias = alias;
JAVA
if (!(other instanceof TraitAliasStatement)) {
return false;
}
return super.subtreeMatch(matcher, other);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<TraitAliasStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
alias.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</TraitAliasStatement>");
JAVA
TraitAlias alias = ASTNode.copySubtree(target, getAlias());
final TraitAliasStatement result = new TraitAliasStatement(this.getStart(), this.getEnd(), target, alias);
return result;
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
super(start, end, ast, modifier, className, superClass, interfaces, body);
JAVA
super(ast);
JAVA
if (!(other instanceof TraitDeclaration)) {
return false;
}
return super.subtreeMatch(matcher, other);
JAVA
final Block body = ASTNode.copySubtree(target, getBody());
final int modifier = getModifier();
final Identifier name = ASTNode.copySubtree(target, getName());
final TraitDeclaration result = new TraitDeclaration(getStart(), getEnd(), target, modifier, name, getName(), interfaces(), body);
return result;
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<TraitDeclaration");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append("'>\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("<TraitName>\n");
getName().toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append(TAB).append("</TraitName>\n");
getBody().toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</TraitDeclaration>");
JAVA
return ASTNode.CLASS_DECLARATION;
JAVA
new ASTNode.NodeList<NamespaceName>(TRAIT_REFERENCE_LIST)
JAVA
new ChildPropertyDescriptor(TraitPrecedence.class, "methodReference", FullyQualifiedTraitMethodReference.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new ChildListPropertyDescriptor(TraitPrecedence.class, "trList", NamespaceName.class, //$NON-NLS-1$
CYCLE_RISK)
JAVA
super(start, end, ast);
setMethodReference(methodReference);
if (trList != null) {
this.trList.addAll(trList);
}
JAVA
super(ast);
JAVA
return methodReference;
JAVA
if (methodReference == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.methodReference;
preReplaceChild(oldChild, methodReference, METHOD_REFERENCE);
this.methodReference = methodReference;
postReplaceChild(oldChild, methodReference, METHOD_REFERENCE);
JAVA
return trList;
JAVA
this.trList.clear();
if (trList != null) {
this.trList.addAll(trList);
}
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
methodReference.accept(visitor);
if (trList != null) {
for (NamespaceName name : trList) {
name.accept(visitor);
}
}
JAVA
accept(visitor);
methodReference.traverseTopDown(visitor);
if (trList != null) {
for (NamespaceName name : trList) {
name.traverseTopDown(visitor);
}
}
JAVA
methodReference.traverseBottomUp(visitor);
if (trList != null) {
for (NamespaceName name : trList) {
name.traverseBottomUp(visitor);
}
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<TraitPrecedence");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
methodReference.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
if (trList != null) {
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<TraitReferenceList>\n");
for (NamespaceName name : trList) {
name.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append(//$NON-NLS-1$
"\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</TraitReferenceList>\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</TraitPrecedence>");
JAVA
return ASTNode.FUNCTION_NAME;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
FullyQualifiedTraitMethodReference methodReference = ASTNode.copySubtree(target, getMethodReference());
List<NamespaceName> trList = ASTNode.copySubtrees(target, getTrList());
final TraitPrecedence result = new TraitPrecedence(this.getStart(), this.getEnd(), target, methodReference, trList);
return result;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == METHOD_REFERENCE) {
if (get) {
return getMethodReference();
} else {
setMethodReference((FullyQualifiedTraitMethodReference) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
if (property == TRAIT_REFERENCE_LIST) {
return getTrList();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
super(start, end, ast, precedence);
this.precedence = precedence;
JAVA
super(ast);
JAVA
return precedence;
JAVA
setExp(precedence);
this.precedence = precedence;
JAVA
if (!(other instanceof TraitPrecedenceStatement)) {
return false;
}
return super.subtreeMatch(matcher, other);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<TraitPrecedenceStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
precedence.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</TraitPrecedenceStatement>");
JAVA
TraitPrecedence precedence = ASTNode.copySubtree(target, getPrecedence());
final TraitPrecedenceStatement result = new TraitPrecedenceStatement(this.getStart(), this.getEnd(), target, precedence);
return result;
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
new ChildPropertyDescriptor(TraitStatement.class, "exp", Expression.class, MANDATORY, //$NON-NLS-1$
CYCLE_RISK)
JAVA
super(start, end, ast);
setExp(exp);
JAVA
super(ast);
JAVA
return exp;
JAVA
if (exp == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.exp;
preReplaceChild(oldChild, exp, EXP);
this.exp = exp;
postReplaceChild(oldChild, exp, EXP);
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
exp.accept(visitor);
JAVA
accept(visitor);
exp.traverseTopDown(visitor);
JAVA
exp.traverseBottomUp(visitor);
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<TraitStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
exp.toString(buffer, TAB + tab);
//$NON-NLS-1$
buffer.append("\n");
//$NON-NLS-1$
buffer.append(tab).append("</TraitStatement>");
JAVA
return ASTNode.FUNCTION_NAME;
JAVA
// dispatch to correct overloaded match method
return matcher.match(this, other);
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
if (property == EXP) {
if (get) {
return getExp();
} else {
setExp((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
new ASTNode.NodeList<NamespaceName>(TRAIT)
JAVA
new ASTNode.NodeList<TraitStatement>(TRAIT_STATEMENT)
JAVA
new ChildListPropertyDescriptor(TraitUseStatement.class, "traitList", NamespaceName.class, //$NON-NLS-1$
CYCLE_RISK)
JAVA
new ChildListPropertyDescriptor(TraitUseStatement.class, "tsList", TraitStatement.class, //$NON-NLS-1$
CYCLE_RISK)
JAVA
super(start, end, ast);
if (traitList != null) {
this.traitList.addAll(traitList);
}
if (tsList != null) {
this.tsList.addAll(tsList);
}
JAVA
super(ast);
JAVA
for (ASTNode node : traitList) {
node.accept(visitor);
}
for (ASTNode node : tsList) {
node.accept(visitor);
}
JAVA
for (ASTNode node : traitList) {
node.traverseTopDown(visitor);
}
for (ASTNode node : tsList) {
node.traverseTopDown(visitor);
}
JAVA
for (ASTNode node : traitList) {
node.traverseBottomUp(visitor);
}
for (ASTNode node : tsList) {
node.traverseBottomUp(visitor);
}
accept(visitor);
JAVA
//$NON-NLS-1$
buffer.append(tab).append("<TraitUseStatement");
appendInterval(buffer);
//$NON-NLS-1$
buffer.append(">\n");
if (traitList != null && !traitList.isEmpty()) {
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<TraitNameList>\n");
for (NamespaceName name : traitList) {
name.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append(//$NON-NLS-1$
"\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</TraitNameList>\n");
}
if (tsList != null && !tsList.isEmpty()) {
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("<TraitStatementList>\n");
for (TraitStatement name : tsList) {
name.toString(buffer, TAB + TAB + tab);
//$NON-NLS-1$
buffer.append(//$NON-NLS-1$
"\n");
}
//$NON-NLS-1$
buffer.append(TAB).append(tab).append("</TraitStatementList>\n");
}
//$NON-NLS-1$
buffer.append(tab).append("</TraitUseStatement>");
JAVA
final boolean visit = visitor.visit(this);
if (visit) {
childrenAccept(visitor);
}
visitor.endVisit(this);
JAVA
return matcher.match(this, other);
JAVA
return TRAIT_USE_STATEMENT;
JAVA
return PROPERTY_DESCRIPTORS;
JAVA
final List<NamespaceName> traitList = ASTNode.copySubtrees(target, getTraitList());
List<TraitStatement> tsList = ASTNode.copySubtrees(target, getTsList());
final TraitUseStatement result = new TraitUseStatement(this.getStart(), this.getEnd(), target, traitList, tsList);
return result;
JAVA
return traitList;
JAVA
this.traitList.clear();
if (traitList != null) {
this.traitList.addAll(traitList);
}
JAVA
return tsList;
JAVA
this.tsList.clear();
if (tsList != null) {
this.tsList.addAll(tsList);
}
JAVA
if (property == TRAIT) {
return getTraitList();
} else if (property == TRAIT_STATEMENT) {
return getTsList();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
"\t"
JAVA
if (node == null)
return null;
do {
node = node.getParent();
} while (node != null && !parentClass.isInstance(node));
return node;
JAVA
if (node == null)
return null;
do {
node = node.getParent();
} while (node != null && node.getType() != nodeType);
return node;
JAVA
assert node != null;
int type = node.getType();
return (type == ASTNode.IF_STATEMENT || type == ASTNode.FOR_STATEMENT || type == ASTNode.FOR_EACH_STATEMENT || type == ASTNode.WHILE_STATEMENT || type == ASTNode.DO_STATEMENT);
JAVA
final StringBuilder builder = new StringBuilder();
node.accept(new AbstractVisitor() {
@Override
public boolean visit(Scalar scalar) {
builder.append(scalar.getStringValue());
return true;
}
});
return builder.toString();
JAVA
new StringReader("")
JAVA
this.ast = new AST(reader, phpVersion, useASPTags, useShortTags);
this.ast.setDefaultNodeFlag(ASTNode.ORIGINAL);
JAVA
try {
return new //$NON-NLS-1$
ASTParser(//$NON-NLS-1$
new StringReader(""), //$NON-NLS-1$
version, //$NON-NLS-1$
false, useShortTags);
} catch (IOException e) {
assert false;
return null;
}
JAVA
final Scanner lexer = this.ast.lexer();
final lr_parser phpParser = this.ast.parser();
phpParser.setScanner(lexer);
final Symbol symbol = phpParser.parse();
if (symbol == null || !(symbol.value instanceof Program)) {
return null;
}
Program p = (Program) symbol.value;
AST ast = p.getAST();
// now reset the ast default node flag back to differntate between
// original nodes
ast.setDefaultNodeFlag(0);
// Set the original modification count to the count after the creation
// of the Program.
// This is important to allow the AST rewriting.
ast.setOriginalModificationCount(ast.modificationCount());
return p;
JAVA
return newParser(version, true);
JAVA
final CharArrayReader charArrayReader = new CharArrayReader(source);
setSource(charArrayReader);
JAVA
InputStreamReader reader = new InputStreamReader(source);
this.ast.setSource(reader);
JAVA
FileInputStream input = new FileInputStream(source);
InputStreamReader reader = new InputStreamReader(input);
this.ast.setSource(reader);
JAVA
this.ast.setSource(source);
JAVA
return new org.eclipse.php.internal.core.ast.scanner.php53.PhpAstLexer(ASTParser.EMPTY_STRING_READER);
JAVA
return new org.eclipse.php.internal.core.ast.scanner.php54.PhpAstLexer(ASTParser.EMPTY_STRING_READER);
JAVA
return new org.eclipse.php.internal.core.ast.scanner.php54.PhpAstParser(createEmptyLexer_54());
JAVA
return new org.eclipse.php.internal.core.ast.scanner.php53.PhpAstParser(createEmptyLexer_53());
JAVA
return new org.eclipse.php.internal.core.ast.scanner.php5.PhpAstLexer(ASTParser.EMPTY_STRING_READER);
JAVA
return new org.eclipse.php.internal.core.ast.scanner.php5.PhpAstParser(createEmptyLexer_5());
JAVA
return new org.eclipse.php.internal.core.ast.scanner.php4.PhpAstLexer(ASTParser.EMPTY_STRING_READER);
JAVA
return new org.eclipse.php.internal.core.ast.scanner.php4.PhpAstParser(createEmptyLexer_4());
JAVA
super(start, end, ast);
setModifier(shouldComplete ? completeModifier(modifier) : modifier);
JAVA
this(start, end, ast, modifier, false);
JAVA
super(ast);
JAVA
if (!PHPFlags.isPrivate(mod) && !PHPFlags.isProtected(mod)) {
mod |= Modifiers.AccPublic;
}
return mod;
JAVA
return PHPFlags.toString(modifier);
JAVA
return modifier;
JAVA
if (PHPFlags.toString(modifier) == null) {
//$NON-NLS-1$
throw new IllegalArgumentException("Invalid modifier");
}
preValueChange(getModifierProperty());
this.modifier = modifier;
postValueChange(getModifierProperty());
JAVA
if (property == getModifierProperty()) {
if (get) {
return getModifier();
} else {
setModifier(value);
return 0;
}
}
// allow default implementation to flag the error
return super.internalGetSetIntProperty(property, get, value);
JAVA
0x00000001
JAVA
0x00000002
JAVA
0x00000004
JAVA
0x00000008
JAVA
0x00000010
JAVA
0x00000400
JAVA
return (mod & PUBLIC) != 0;
JAVA
return (mod & PRIVATE) != 0;
JAVA
return (mod & PROTECTED) != 0;
JAVA
return (mod & STATIC) != 0;
JAVA
return (mod & FINAL) != 0;
JAVA
return (mod & ABSTRACT) != 0;
JAVA
StringBuffer sb = new StringBuffer();
if ((mod & PUBLIC) != 0) {
//$NON-NLS-1$
sb.append(//$NON-NLS-1$
"public ");
}
if ((mod & PROTECTED) != 0) {
//$NON-NLS-1$
sb.append(//$NON-NLS-1$
"protected ");
}
if ((mod & PRIVATE) != 0) {
//$NON-NLS-1$
sb.append(//$NON-NLS-1$
"private ");
}
//Canonical order
if ((mod & ABSTRACT) != 0) {
//$NON-NLS-1$
sb.append(//$NON-NLS-1$
"abstract ");
}
if ((mod & STATIC) != 0) {
//$NON-NLS-1$
sb.append(//$NON-NLS-1$
"static ");
}
if ((mod & FINAL) != 0) {
//$NON-NLS-1$
sb.append(//$NON-NLS-1$
"final ");
}
int len;
if ((len = sb.length()) > 0) /* trim trailing space */
{
return sb.toString().substring(0, len - 1);
}
//$NON-NLS-1$
return "";
JAVA
new ASTNode.NodeList<Identifier>(getInterfacesProperty())
JAVA
super(start, end, ast);
if (name == null || body == null) {
throw new IllegalArgumentException();
}
setName(name);
setBody(body);
if (interfaces != null) {
for (Identifier identifier : interfaces) {
this.interfaces.add(identifier);
}
}
JAVA
super(ast);
JAVA
return body;
JAVA
if (block == null) {
throw new IllegalArgumentException();
}
// an Assignment may occur inside a Expression - must check cycles
ASTNode oldChild = this.body;
preReplaceChild(oldChild, block, getBodyProperty());
this.body = block;
postReplaceChild(oldChild, block, getBodyProperty());
JAVA
return this.interfaces.toArray(new Identifier[interfaces.size()]);
JAVA
return this.interfaces;
JAVA
return this.name;
JAVA
if (id == null) {
throw new IllegalArgumentException();
}
// an Assignment may occur inside a Expression - must check cycles
ASTNode oldChild = this.name;
preReplaceChild(oldChild, id, getNameProperty());
this.name = id;
postReplaceChild(oldChild, id, getNameProperty());
JAVA
if (property == getNameProperty()) {
if (get) {
return getName();
} else {
setName((Identifier) child);
return null;
}
}
if (property == getBodyProperty()) {
if (get) {
return getBody();
} else {
setBody((Block) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
if (property == getInterfacesProperty()) {
return interfaces();
}
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
JAVA
super(start, end, ast);
if (dispatcher == null) {
throw new IllegalArgumentException();
}
setDispatcher(dispatcher);
JAVA
super(ast);
JAVA
return dispatcher;
JAVA
if (dispatcher == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.dispatcher;
preReplaceChild(oldChild, dispatcher, getDispatcherProperty());
this.dispatcher = dispatcher;
postReplaceChild(oldChild, dispatcher, getDispatcherProperty());
JAVA
if (property == getDispatcherProperty()) {
if (get) {
return getDispatcher();
} else {
setDispatcher((VariableBase) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
JAVA
1
JAVA
2
JAVA
3
JAVA
4
JAVA
5
JAVA
6
JAVA
7
JAVA
8
JAVA
super(start, end, ast);
if (className == null) {
throw new IllegalArgumentException();
}
setClassName(className);
JAVA
super(ast);
JAVA
return className;
JAVA
if (name == null) {
throw new IllegalArgumentException();
}
// an Assignment may occur inside a Expression - must check cycles
ASTNode oldChild = this.className;
preReplaceChild(oldChild, name, getClassNameProperty());
this.className = name;
postReplaceChild(oldChild, name, getClassNameProperty());
JAVA
if (property == getClassNameProperty()) {
if (get) {
return getClassName();
} else {
setClassName((Expression) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);