eu.cqse.check.framework.preprocessor.c.IMacroProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of teamscale-check-api Show documentation
Show all versions of teamscale-check-api Show documentation
The Teamscale Custom Check API allows users to extend Teamscale by writing custom analyses that create findings.
/*
* Copyright (c) CQSE GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.cqse.check.framework.preprocessor.c;
/**
* Interface for providing macros.
*/
public interface IMacroProvider {
/** Returns whether the macro of given name is defined. */
boolean isDefined(String name);
/**
* Returns whether the given macro name has been explicitly undefined in the code. In this case,
* even if we have a default definition of this macro, we should not use it.
*
* For example, this code expands to "no" in gcc:
* #undef __FILE__
* #ifdef __FILE__
* yes
* #else
* no
* #endif
*/
boolean isExplicitylUndefined(String name);
/**
* Returns the definition of the given macro without the leading '#' and 'define'. Returns null if
* no macro of given name is defined. For an empty macro, the empty string will be returned.
*/
String getDefinition(String name);
}