mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-02 05:45:58 +02:00
Removed prematurely submitted classes.
This commit is contained in:
parent
f02e178d52
commit
b9097cd175
2 changed files with 0 additions and 102 deletions
|
@ -1,43 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2012 Google, Inc and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* Sergey Prigogin (Google) - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTToken;
|
|
||||||
import org.eclipse.cdt.core.parser.IToken;
|
|
||||||
import org.eclipse.cdt.internal.core.parser.scanner.Token;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Base class for C and C++ attributes.
|
|
||||||
*/
|
|
||||||
public class ASTToken extends ASTNode implements IASTToken {
|
|
||||||
private final IToken token;
|
|
||||||
|
|
||||||
public ASTToken(IToken token) {
|
|
||||||
this.token = token;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ASTToken copy() {
|
|
||||||
return copy(CopyStyle.withoutLocations);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ASTToken copy(CopyStyle style) {
|
|
||||||
Token tokenCopy = ((Token) token).clone();
|
|
||||||
tokenCopy.setNext(null);
|
|
||||||
return super.copy(new ASTToken(tokenCopy), style);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IToken getToken() {
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,59 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2012 Google, Inc and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* Sergey Prigogin (Google) - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTToken;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTokenList;
|
|
||||||
import org.eclipse.cdt.core.parser.IToken;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a sequence of code tokens.
|
|
||||||
*/
|
|
||||||
public class ASTTokenList extends ASTNode implements IASTTokenList {
|
|
||||||
private IASTToken[] tokens = IASTToken.EMPTY_TOKEN_ARRAY;
|
|
||||||
|
|
||||||
public ASTTokenList() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ASTTokenList copy() {
|
|
||||||
return copy(CopyStyle.withoutLocations);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ASTTokenList copy(CopyStyle style) {
|
|
||||||
ASTTokenList copy = super.copy(new ASTTokenList(), style);
|
|
||||||
for (IASTToken token : tokens) {
|
|
||||||
if (token == null)
|
|
||||||
break;
|
|
||||||
copy.addToken(token.copy(style));
|
|
||||||
}
|
|
||||||
return copy;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTToken[] getTokens() {
|
|
||||||
tokens = ArrayUtil.trim(tokens);
|
|
||||||
return tokens;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addToken(IASTToken token) {
|
|
||||||
tokens = ArrayUtil.append(tokens, token);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IToken getToken() {
|
|
||||||
IASTToken[] tok = getTokens();
|
|
||||||
return tok != null && tok.length == 1 ? tok[0].getToken() : null;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue