private boolean isArrayWithInitialization(ISyntaxNode node) { return node.getChild(0).getType().equals("new.array.initialized"); } }
public IBoundNode bind(ISyntaxNode node, IBindingContext bindingContext) throws Exception { return bindChildNode(node.getChild(0), bindingContext); } }
private boolean isArrayWithInitialization(ISyntaxNode node) { return node.getChild(0).getType().equals("new.array.initialized"); } }
public IBoundNode bind(ISyntaxNode node, IBindingContext bindingContext) throws Exception { return bindChildNode(node.getChild(0), bindingContext); } }
private String concatChildren(ISyntaxNode node) { StringBuilder builder = new StringBuilder(100); for (int i = 0; i < node.getNumberOfChildren(); i++) { builder.append(((IdentifierNode) node.getChild(i)).getIdentifier()); } return builder.toString(); }
private String concatChildren(ISyntaxNode node) { StringBuilder builder = new StringBuilder(100); for (int i = 0; i < node.getNumberOfChildren(); i++) { builder.append(((IdentifierNode) node.getChild(i)).getIdentifier()); } return builder.toString(); }
public IBoundNode bind(ISyntaxNode node, IBindingContext bindingContext) throws Exception { IBoundNode[] boundNodes = makeLocalVarsFromWhere(node.getChild(1), bindingContext); IBoundNode exprNode = bindChildNode(node.getChild(0), bindingContext); boundNodes[boundNodes.length - 1] = exprNode; return new BlockNode(node, 0, boundNodes); }
public IBoundNode bind(ISyntaxNode node, IBindingContext bindingContext) throws Exception { String nodeType = node.getType(); int targetInd = 0; int chainInd = 1; if (nodeType.startsWith("chain.suffix.of.the")) { targetInd = 1; chainInd = 0; } IBoundNode target = bindChildNode(node.getChild(targetInd), bindingContext); IBoundNode result = bindTargetNode(node.getChild(chainInd), bindingContext, target); return result; } }
private static ISyntaxNode getIdentifierSyntaxNode(ISyntaxNode syntaxNode) { if (!(syntaxNode instanceof IdentifierNode)) { if ("function".equals(syntaxNode.getType())) { syntaxNode = syntaxNode.getChild(syntaxNode.getNumberOfChildren() - 1); } } return syntaxNode; }
public IBoundNode bind(ISyntaxNode node, IBindingContext bindingContext) throws Exception { IBoundNode[] boundNodes = makeLocalVarsFromWhere(node.getChild(1), bindingContext); IBoundNode exprNode = bindChildNode(node.getChild(0), bindingContext); boundNodes[boundNodes.length - 1] = exprNode; return new BlockNode(node, 0, boundNodes); }
public ILocation getParamTypeLocation(int paramNum) { // 0-th child is param type, 1-st child is param name. See ParameterDeclarationNodeBinder ISyntaxNode typeNode = children[paramNum].getSyntaxNode().getChild(0); while (typeNode.getNumberOfChildren() == 1 && !(typeNode instanceof IdentifierNode)) { // Get type node for array typeNode = typeNode.getChild(0); } return typeNode.getSourceLocation(); }
public ILocation getParamTypeLocation(int paramNum) { // 0-th child is param type, 1-st child is param name. See ParameterDeclarationNodeBinder ISyntaxNode typeNode = children[paramNum].getSyntaxNode().getChild(0); while (typeNode.getNumberOfChildren() == 1 && !(typeNode instanceof IdentifierNode)) { // Get type node for array typeNode = typeNode.getChild(0); } return typeNode.getSourceLocation(); }
private static IBoundNode[] makeLocalVarsFromWhere(ISyntaxNode whereNode, IBindingContext bindingContext) throws Exception { int n = whereNode.getNumberOfChildren(); IBoundNode[] boundNodes = new IBoundNode[n + 1]; for (int i = 0; i < n; i++) { boundNodes[i] = makeLocalVar(whereNode.getChild(i), bindingContext); } return boundNodes; }
public IBoundNode bind(ISyntaxNode node, IBindingContext bindingContext) throws Exception { IBoundNode typeNode = bindChildNode(node.getChild(TYPE_NODE), bindingContext); String methodName = ((IdentifierNode) node.getChild(METHOD_NAME_NODE)).getIdentifier(); ISyntaxNode methodBodyNode = node.getChild(BODY_NODE); ISyntaxNode parametersNode = node.getChild(PARAMETERS_NODE); MethodParametersNode boundParametersNode = (MethodParametersNode) bindChildNode(parametersNode, bindingContext); DeferredMethod dm = new DeferredMethod(methodName, typeNode.getType(), boundParametersNode.getSignature(), null, methodBodyNode); return new MethodNode(node, dm); }
public IBoundNode bind(ISyntaxNode node, IBindingContext bindingContext) throws Exception { IBoundNode typeNode = bindChildNode(node.getChild(TYPE_NODE), bindingContext); String methodName = ((IdentifierNode) node.getChild(METHOD_NAME_NODE)).getIdentifier(); ISyntaxNode methodBodyNode = node.getChild(BODY_NODE); ISyntaxNode parametersNode = node.getChild(PARAMETERS_NODE); MethodParametersNode boundParametersNode = (MethodParametersNode) bindChildNode(parametersNode, bindingContext); DeferredMethod dm = new DeferredMethod(methodName, typeNode.getType(), boundParametersNode.getSignature(), null, methodBodyNode); return new MethodNode(node, dm); }
private static IBoundNode[] makeLocalVarsFromWhere(ISyntaxNode whereNode, IBindingContext bindingContext) throws Exception { int n = whereNode.getNumberOfChildren(); IBoundNode[] boundNodes = new IBoundNode[n + 1]; for (int i = 0; i < n; i++) { boundNodes[i] = makeLocalVar(whereNode.getChild(i), bindingContext); } return boundNodes; }
public IBoundNode bind(ISyntaxNode node, IBindingContext bindingContext) throws Exception { IBoundNode typeNode = bindChildNode(node.getChild(0), bindingContext); String name = ((IdentifierNode) node.getChild(1)).getIdentifier(); IOpenClass type = typeNode.getType(); return new ParameterNode(node, name, type); }
public IBoundNode bind(ISyntaxNode node, IBindingContext bindingContext) throws Exception { IBoundNode typeNode = bindChildNode(node.getChild(0), bindingContext); String name = ((IdentifierNode) node.getChild(1)).getIdentifier(); IOpenClass type = typeNode.getType(); return new ParameterNode(node, name, type); }