1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-20 07:25:23 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2016-05-24 13:51:28 -07:00
parent e6bec45296
commit bb53b9e92f
2 changed files with 13 additions and 10 deletions

View file

@ -920,20 +920,22 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
if (mode == ParserMode.QUICK_PARSE || mode == ParserMode.STRUCTURAL_PARSE || !isActiveCode()) {
skipOverCompoundStatement(true);
} else if (mode == ParserMode.COMPLETION_PARSE || mode == ParserMode.SELECTION_PARSE) {
if (scanner.isOnTopContext())
if (scanner.isOnTopContext()) {
compoundStatement();
else
} else {
skipOverCompoundStatement(true);
} else if (mode == ParserMode.COMPLETE_PARSE)
}
} else if (mode == ParserMode.COMPLETE_PARSE) {
compoundStatement = compoundStatement();
}
int lastOffset = consume(IToken.tRPAREN).getEndOffset();
IGNUASTCompoundStatementExpression resultExpression = nodeFactory.newGNUCompoundStatementExpression(compoundStatement);
IGNUASTCompoundStatementExpression resultExpression =
nodeFactory.newGNUCompoundStatementExpression(compoundStatement);
((ASTNode) resultExpression).setOffsetAndLength(startingOffset, lastOffset - startingOffset);
return resultExpression;
}
/**
* Models a cast expression followed by an operator. Can be linked into a chain.
* This is done right to left, such that a tree of variants can be built.
@ -946,7 +948,8 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
IASTInitializerClause fExpression;
final CastAmbiguityMarker fAmbiguityMarker;
public BinaryOperator(BinaryOperator nextOp, IASTInitializerClause expression, int operatorToken, int leftPrecedence, int rightPrecedence) {
public BinaryOperator(BinaryOperator nextOp, IASTInitializerClause expression, int operatorToken,
int leftPrecedence, int rightPrecedence) {
fNext= nextOp;
fOperatorToken= operatorToken;
fLeftPrecedence= leftPrecedence;
@ -1014,7 +1017,8 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
negative= operator.fNext.fExpression;
operator.fNext= operator.fNext.fNext;
}
IASTConditionalExpression conditionalEx = nodeFactory.newConditionalExpession(left, (IASTExpression) right, (IASTExpression) negative);
IASTConditionalExpression conditionalEx =
nodeFactory.newConditionalExpession(left, (IASTExpression) right, (IASTExpression) negative);
setRange(conditionalEx, left);
if (negative != null) {
adjustLength(conditionalEx, negative);

View file

@ -12,8 +12,6 @@ package org.eclipse.cdt.core.dom.lrparser.action.gnu;
import java.util.List;
import lpg.lpgjavaruntime.IToken;
import org.eclipse.cdt.core.dom.ast.IASTASMDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
import org.eclipse.cdt.core.dom.ast.IASTName;
@ -25,6 +23,8 @@ import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack;
import org.eclipse.cdt.core.dom.lrparser.action.TokenMap;
import org.eclipse.cdt.internal.core.dom.lrparser.gcc.GCCParsersym;
import lpg.lpgjavaruntime.IToken;
public class GNUBuildASTParserAction extends AbstractParserAction {
private final INodeFactory nodeFactory;
@ -84,7 +84,6 @@ public class GNUBuildASTParserAction extends AbstractParserAction {
astStack.push(asm);
}
/**
* primary_expression
* ::= '(' compound_statement ')'