Search in sources :

Example 1 with InternalSyntaxSpacing

use of org.sonar.java.model.InternalSyntaxSpacing in project sonar-java by SonarSource.

the class JavaNodeBuilder method createNonTerminal.

@Override
public Object createNonTerminal(GrammarRuleKey ruleKey, Rule rule, List<Object> children, int startIndex, int endIndex) {
    for (Object child : children) {
        if (child instanceof InternalSyntaxToken) {
            InternalSyntaxToken syntaxToken = (InternalSyntaxToken) child;
            syntaxToken.setGrammarRuleKey(ruleKey);
            return child;
        }
    }
    return new InternalSyntaxSpacing(startIndex, endIndex);
}
Also used : InternalSyntaxSpacing(org.sonar.java.model.InternalSyntaxSpacing) InternalSyntaxToken(org.sonar.java.model.InternalSyntaxToken)

Aggregations

InternalSyntaxSpacing (org.sonar.java.model.InternalSyntaxSpacing)1 InternalSyntaxToken (org.sonar.java.model.InternalSyntaxToken)1