/** * Constructor. */ public FunctionCallNode(IASToken keywordNew, ExpressionNodeBase nameNode) { assert keywordNew != null : "Expected 'new' token."; assert nameNode != null : "Expected name expression."; newKeywordNode = new KeywordNode(keywordNew); this.nameNode = nameNode; argumentsNode = new ContainerNode(2); }
/** * Constructor. */ public FunctionCallNode(ExpressionNodeBase nameNode) { newKeywordNode = null; this.nameNode = nameNode; argumentsNode = new ContainerNode(2); setSourceLocation(nameNode); }
/** * Constructor. */ public FunctionCallNode(ExpressionNodeBase nameNode) { newKeywordNode = null; this.nameNode = nameNode; argumentsNode = new ContainerNode(2); setSourceLocation(nameNode); }
/** * Constructor. */ public FunctionCallNode(IASToken keywordNew, ExpressionNodeBase nameNode) { assert keywordNew != null : "Expected 'new' token."; assert nameNode != null : "Expected name expression."; newKeywordNode = new KeywordNode(keywordNew); this.nameNode = nameNode; argumentsNode = new ContainerNode(2); }
public FunctionContentsPart() { super(); argumentsNode = new ContainerNode(2); argumentsNode.setContainerType(ContainerType.PARENTHESIS); contentsNode = new ScopedBlockNode(false); // Set the contents to implicit - the parser will set to BRACES if it // sees a function body contentsNode.setContainerType(ContainerType.SYNTHESIZED); }
public FunctionContentsPart() { super(); argumentsNode = new ContainerNode(2); argumentsNode.setContainerType(ContainerType.PARENTHESIS); contentsNode = new ScopedBlockNode(false); // Set the contents to implicit - the parser will set to BRACES if it // sees a function body contentsNode.setContainerType(ContainerType.SYNTHESIZED); }
/** * Constructor. */ public ForLoopNode(IASToken forKeyword) { super(); if (forKeyword != null) { startBefore(forKeyword); if (forKeyword.getText().length() == 3) kind = ForLoopKind.FOR; else kind = ForLoopKind.FOR_EACH; } else { kind = ForLoopKind.FOR; } conditionsStatementsNode = new ContainerNode(); contentsNode = new BlockNode(); }
/** * Constructor. */ public ForLoopNode(IASToken forKeyword) { super(); if (forKeyword != null) { startBefore(forKeyword); if (forKeyword.getText().length() == 3) kind = ForLoopKind.FOR; else kind = ForLoopKind.FOR_EACH; } else { kind = ForLoopKind.FOR; } conditionsStatementsNode = new ContainerNode(); contentsNode = new BlockNode(); }
/** * Constructor. */ public BaseLiteralContainerNode(LiteralNode baseTypeNode) { this.baseTypeNode = baseTypeNode; baseTypeNode.setParent(this); contentsNode = new ContainerNode(); switch (baseTypeNode.getLiteralType()) { case ARRAY: { contentsNode.setContainerType(ContainerType.BRACKETS); break; } case OBJECT: case VECTOR: { contentsNode.setContainerType(ContainerType.BRACES); break; } } }
/** * Constructor. */ @SuppressWarnings("incomplete-switch") public BaseLiteralContainerNode(LiteralNode baseTypeNode) { this.baseTypeNode = baseTypeNode; baseTypeNode.setParent(this); contentsNode = new ContainerNode(); switch (baseTypeNode.getLiteralType()) { case ARRAY: { contentsNode.setContainerType(ContainerType.BRACKETS); break; } case OBJECT: case VECTOR: { contentsNode.setContainerType(ContainerType.BRACES); break; } } }
/** * Copy constructor. * * @param other The node to copy. */ protected FunctionCallNode(FunctionCallNode other) { super(other); this.newKeywordNode = other.newKeywordNode != null ? new KeywordNode(other.newKeywordNode) : null; this.nameNode = other.nameNode != null ? other.nameNode.copy() : null; this.argumentsNode = new ContainerNode(other.argumentsNode.getChildCount()); for (IExpressionNode arg : other.getArgumentNodes()) { argumentsNode.addItem(((ExpressionNodeBase)arg).copy()); } }
/** * Copy constructor. * * @param other The node to copy. */ protected FunctionCallNode(FunctionCallNode other) { super(other); this.newKeywordNode = other.newKeywordNode != null ? new KeywordNode(other.newKeywordNode) : null; this.nameNode = other.nameNode != null ? other.nameNode.copy() : null; this.argumentsNode = new ContainerNode(other.argumentsNode.getChildCount()); for (IExpressionNode arg : other.getArgumentNodes()) { argumentsNode.addItem(((ExpressionNodeBase)arg).copy()); } }
c = new ContainerNode();
public static IContainerNode insertArgumentsBefore(IContainerNode argumentsNode, IASNode... nodes) { int originalLength = argumentsNode.getChildCount(); int extraLength = nodes.length; ContainerNode result = new ContainerNode(originalLength + extraLength); result.setSourcePath(argumentsNode.getSourcePath()); result.span(argumentsNode); result.setParent((NodeBase) argumentsNode.getParent()); for (int i = 0; i < extraLength; i++) { NodeBase node = (NodeBase) nodes[i]; node.setSourcePath(argumentsNode.getSourcePath()); result.addItem(node); } for (int i = 0; i < originalLength; i++) { result.addItem((NodeBase) argumentsNode.getChild(i)); } return result; }
public static IContainerNode insertArgumentsAfter(IContainerNode argumentsNode, IASNode... nodes) { int originalLength = argumentsNode.getChildCount(); int extraLength = nodes.length; ContainerNode result = new ContainerNode(originalLength + extraLength); result.setSourcePath(argumentsNode.getSourcePath()); result.span(argumentsNode); result.setParent((NodeBase) argumentsNode.getParent()); for (int i = 0; i < originalLength; i++) { result.addItem((NodeBase) argumentsNode.getChild(i)); } for (int i = 0; i < extraLength; i++) { NodeBase node = (NodeBase) nodes[i]; node.setSourcePath(argumentsNode.getSourcePath()); result.addItem(node); } return result; }
ContainerNode result = new ContainerNode(originalLength + extraLength); result.setSourcePath(argumentsNode.getSourcePath()); result.span(argumentsNode);
c = new ContainerNode(); c.setStart(v.getStart()); c.addItem(v);
c = new ContainerNode(); c.setStart(v.getStart()); c.addItem(v);