mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 12:55:40 +02:00
Interface of the Makefile parser
This commit is contained in:
parent
371823e7b4
commit
3e86e80afd
10 changed files with 250 additions and 0 deletions
|
@ -0,0 +1,57 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2002,2003 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.make.core.makefile;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ICommand
|
||||||
|
*/
|
||||||
|
public interface ICommand extends IStatement {
|
||||||
|
|
||||||
|
final public static char HYPHEN = '-';
|
||||||
|
|
||||||
|
final public static String HYPHEN_STRING = "-";
|
||||||
|
|
||||||
|
final public static char AT = '@';
|
||||||
|
|
||||||
|
final public static String AT_STRING = "@";
|
||||||
|
|
||||||
|
final public static char PLUS = '+';
|
||||||
|
|
||||||
|
final public static String PLUS_STRING = "+";
|
||||||
|
|
||||||
|
final public static char TAB = '\t';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* - If the command prefix contains a hyphen, or the -i option is
|
||||||
|
* present, or the special target .IGNORE has either the current
|
||||||
|
* target as a prerequisite or has no prerequisites, any error
|
||||||
|
* found while executing the command will be ignored.
|
||||||
|
*/
|
||||||
|
boolean shouldIgnoreError();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ If the command prefix contains an at sign and the
|
||||||
|
* command-line -n option is not specified, or the -s option is
|
||||||
|
* present, or the special target .SILENT has either the current
|
||||||
|
* target as a prerequisite or has no prerequisites, the command
|
||||||
|
* will not be written to standard output before it is executed.
|
||||||
|
*/
|
||||||
|
boolean shouldBeSilent();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* + If the command prefix contains a plus sign, this indicates a
|
||||||
|
* command line that will be executed even if -n, -q or -t is
|
||||||
|
* specified.
|
||||||
|
*/
|
||||||
|
boolean shouldExecute();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2002,2003 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.make.core.makefile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IComment
|
||||||
|
*/
|
||||||
|
public interface IComment extends IStatement {
|
||||||
|
|
||||||
|
final public static char POUND = '#';
|
||||||
|
|
||||||
|
final public static String POUND_STRING = "#";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2002,2003 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.make.core.makefile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IEmptyLine
|
||||||
|
*/
|
||||||
|
public interface IEmptyLine extends IStatement {
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2002,2003 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.make.core.makefile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IInferenceRule
|
||||||
|
*/
|
||||||
|
public interface IInferenceRule extends IRule {
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2002,2003 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.make.core.makefile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IMacroDefinition
|
||||||
|
*/
|
||||||
|
public interface IMacroDefinition extends IStatement {
|
||||||
|
|
||||||
|
public abstract String getName();
|
||||||
|
|
||||||
|
public abstract String getValue();
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2002,2003 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.make.core.makefile;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IMakefile
|
||||||
|
*/
|
||||||
|
public interface IMakefile {
|
||||||
|
IStatement[] getStatements();
|
||||||
|
IRule[] getRules();
|
||||||
|
IRule[] getRule(String target);
|
||||||
|
IInferenceRule[] getInferenceRules();
|
||||||
|
IInferenceRule[] getInferenceRule(String target);
|
||||||
|
ITargetRule[] getTargetRules();
|
||||||
|
ITargetRule[] getTargetRule(String target);
|
||||||
|
IMacroDefinition[] getMacroDefinitions();
|
||||||
|
IMacroDefinition[] getMacroDefinition(String name);
|
||||||
|
IStatement[] getBuiltins();
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2002,2003 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.make.core.makefile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* There are two kinds of rules: Inference rules and target rules
|
||||||
|
*/
|
||||||
|
public interface IRule extends IStatement {
|
||||||
|
/**
|
||||||
|
* Array of command for the rule.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ICommand[] getCommands();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The rule target name.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ITarget getTarget();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2002,2003 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.make.core.makefile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public interface IStatement {
|
||||||
|
|
||||||
|
int getStartLine();
|
||||||
|
|
||||||
|
int getEndLine();
|
||||||
|
|
||||||
|
String toString();
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2002,2003 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.make.core.makefile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ITarget
|
||||||
|
*/
|
||||||
|
public interface ITarget {
|
||||||
|
String toString();
|
||||||
|
boolean isUptodate();
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2002,2003 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.make.core.makefile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ITargetRule
|
||||||
|
*/
|
||||||
|
public interface ITargetRule extends IRule {
|
||||||
|
ITarget[] getDependencies();
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue