use of org.codehaus.groovy.antlr.GroovySourceAST in project groovy-core by groovy.
the class SimpleGroovyClassDocAssembler method getGrandParentNode.
private GroovySourceAST getGrandParentNode() {
GroovySourceAST grandParentNode = null;
GroovySourceAST parentNode;
GroovySourceAST currentNode = stack.pop();
if (!stack.empty()) {
parentNode = stack.pop();
if (!stack.empty()) {
grandParentNode = stack.peek();
}
stack.push(parentNode);
}
stack.push(currentNode);
return grandParentNode;
}
use of org.codehaus.groovy.antlr.GroovySourceAST in project groovy-core by groovy.
the class SimpleGroovyClassDocAssembler method getTypeArguments.
private void getTypeArguments(GroovySourceAST child, StringBuilder result, String defaultText) {
if (child != null && child.getType() == TYPE_ARGUMENTS && child.getNumberOfChildren() > 0) {
result.append("<");
GroovySourceAST typeArgumentsNext = (GroovySourceAST) child.getFirstChild();
List<String> typeArgumentParts = new ArrayList<String>();
while (typeArgumentsNext != null) {
if (typeArgumentsNext.getType() == TYPE_ARGUMENT && typeArgumentsNext.getNumberOfChildren() > 0) {
typeArgumentParts.add(getTypeNodeAsText((GroovySourceAST) typeArgumentsNext.getFirstChild(), defaultText));
}
typeArgumentsNext = (GroovySourceAST) typeArgumentsNext.getNextSibling();
}
result.append(DefaultGroovyMethods.join(typeArgumentParts, ", "));
result.append(">");
}
}
use of org.codehaus.groovy.antlr.GroovySourceAST in project groovy-core by groovy.
the class SimpleGroovyClassDocAssembler method getParentNode.
private GroovySourceAST getParentNode() {
GroovySourceAST parentNode = null;
GroovySourceAST currentNode = stack.pop();
if (!stack.empty()) {
parentNode = stack.peek();
}
stack.push(currentNode);
return parentNode;
}
use of org.codehaus.groovy.antlr.GroovySourceAST in project groovy-core by groovy.
the class SimpleGroovyClassDocAssembler method getAnnotationNames.
private List<String> getAnnotationNames(GroovySourceAST modifiers) {
List<String> annotationNames = new ArrayList<String>();
List<GroovySourceAST> annotations = modifiers.childrenOfType(ANNOTATION);
for (GroovySourceAST annotation : annotations) {
annotationNames.add(buildName((GroovySourceAST) annotation.getFirstChild()));
}
return annotationNames;
}
use of org.codehaus.groovy.antlr.GroovySourceAST in project groovy-core by groovy.
the class SimpleGroovyClassDocAssembler method getTypeParameters.
private void getTypeParameters(GroovySourceAST child, StringBuilder result, String defaultText) {
if (child != null && child.getType() == TYPE_PARAMETERS && child.getNumberOfChildren() > 0) {
result.append("<");
GroovySourceAST typeParametersNext = (GroovySourceAST) child.getFirstChild();
List<String> typeParameterParts = new ArrayList<String>();
while (typeParametersNext != null) {
if (typeParametersNext.getType() == TYPE_PARAMETER && typeParametersNext.getNumberOfChildren() > 0) {
typeParameterParts.add(getTypeNodeAsText((GroovySourceAST) typeParametersNext.getFirstChild(), defaultText));
}
typeParametersNext = (GroovySourceAST) typeParametersNext.getNextSibling();
}
result.append(DefaultGroovyMethods.join(typeParameterParts, ", "));
result.append(">");
}
}
Aggregations