| LLOOP Index | GSP Language | GSP Library | Framework Classes | Component Classes |
This is the verbatim text of the file "gspc_arguments_make.gsp" part of the LLOOP package. The copyright remains with Michel MEHL. All rights reserved.
import file;
import string;
import quoteorstring;
string BuildConfigurationName;
symbol BuildConfigurationNameOption implements option(
"Build configuration",
"--build-cfg",
"Gives the build configuration.\n\nPossible values are 'debug' and 'release'.\n\nThe default value is 'debug'.",
"--build-cfg",
BuildConfigurationName) ;
symbol SilentBuildOption implements option(
"Silent build",
"--silent-make",
"Tells whether to generate a makefile that works silently, i.e. which does not echo the executed compilation and link commands.",
"--silent-make") ;
symbol BuildTargetDirOption implements option(
"Build target directory",
"--make-target=<DIRECTORY>",
"Target directory for the executable or library.\n\nThe directory is created if it does not exist.\n\nWhen not specified, the current working directory is used, i.e. the directory from which the generator was invoked.",
"--make-target-dir",
forcedir) ;
symbol AdditionalCPPOption implements option(
"Additional source file(s)",
"--cpp-file=<CPP FILE>",
"Additional C++ source file(s) to compile along with the generated code. ",
"--cpp-file",
existingfile) ;
symbol AdditionalIncludePathOption implements option(
"Additional include path(s)",
"--inc-path=<DIRECTORY>",
"Additional include path(s) for finding additional included header files. ",
"--inc-path",
dir) ;
symbol AdditionalLibOption implements option(
"Additional library(ies)",
"--cpp-lib=<FILE OR LIBRARY FLAG>",
"Additional library flag or path to link with. ",
"--cpp-lib",
string) ;
symbol AdditionalLibPathOption implements option(
"Additional library path(s)",
"--lib-path=<DIRECTORY>",
"Additional library path(s) for finding additional libraries to link with.",
"--lib-path",
dir) ;
symbol AdditionalDefinesOption implements option(
"Additional define(s)",
"--make-define=<STRING>",
"Additional define(s).",
"--make-define",
string) ;
symbol AdditionalCompilerFlagsOption implements option(
"Additional compiler flag(s)",
"--cpp-flag=<CPP FILE>",
"Additional compiler flag(s). This is typically compiler/platform-dependent. When makefiles are generated for all platforms, flags may be preceded by 'unix:' or 'windows:' depending on the platform they are intended for.",
"--cpp-flag",
string) ;
symbol TestCommandOption implements option(
"Test command",
"--test-cmd=<STRING>",
"The shell or DOS test command to run the application (if any). The command is executed when the 'test' rule of the makefile is invoked.",
"--test-cmd",
quote_or_string) ;
symbol BuildTargetDirOption occurs at most once;
symbol TestCommandOption occurs at most once;
symbol BuildConfigurationNameOption occurs at most once;
symbol ArgumentMAK extends class OptionsData()
include
"OptionsData.h",
"universal__File.h",
"gspc_arguments_make__BuildConfigurationName.h",
"gspc_arguments_make__StringToken.h",
"gspc_arguments_make__QuoteOrStringToken.h",
"gspc_arguments_make__ForceDirectoryToken.h",
"gspc_arguments_make__DirectoryToken.h",
"gspc_arguments_make__ExistingFileToken.h",
"gspc_arguments_make__ExistingDirectoryToken.h";
/* | SGenConfigurationFileOption */
ArgumentMAK ::= (SilentBuildOption | BuildConfigurationNameOption | AdditionalCPPOption | AdditionalIncludePathOption | AdditionalLibOption| AdditionalLibPathOption | BuildTargetDirOption | AdditionalDefinesOption | AdditionalCompilerFlagsOption | TestCommandOption)
{{
OptionsData& o = dynamic_cast<OptionsData&>(root());
if ($1.getSymbolName() == "SilentBuildOption")
{
o.m_bSilentBuild = true;
}
else if ($1.getSymbolName() == "BuildConfigurationNameOption")
{
o.m_sBuildCfg = dynamic_cast<BuildConfigurationNameOption&>($1).BuildConfigurationNameRef().str();
}
else if ($1.getSymbolName() == "AdditionalCompilerFlagsOption")
{
o.m_saAddCCFlags.insert(o.m_saAddCCFlags.begin(),
dynamic_cast<AdditionalCompilerFlagsOption&>($1).StringTokenRef());
}
else if ($1.getSymbolName() == "AdditionalCPPOption")
{
o.m_saAddSources.insert(o.m_saAddSources.begin(),
dynamic_cast<AdditionalCPPOption&>($1).ExistingFileTokenRef().absolutePath());
}
else if ($1.getSymbolName() == "AdditionalIncludePathOption")
{
AdditionalIncludePathOption& opt = dynamic_cast<AdditionalIncludePathOption&>($1);
o.m_saAddIncPaths.push_back(opt.DirectoryTokenRef().name());
if (!opt.DirectoryTokenRef().exists())
{
warning(cerr, $1.getLineNo(), "include path '%s' does not exist", opt.DirectoryTokenRef().name().str());
}
}
else if ($1.getSymbolName() == "AdditionalLibPathOption")
{
AdditionalLibPathOption& opt = dynamic_cast<AdditionalLibPathOption&>($1);
o.m_saAddLibPaths.push_back(opt.DirectoryTokenRef().name()) ;
if (!opt.DirectoryTokenRef().exists())
{
warning(cerr, $1.getLineNo(), "library path '%s' does not exist", opt.DirectoryTokenRef().name().str());
}
}
else if ($1.getSymbolName() == "AdditionalLibOption")
{
o.m_saAddLibs.push_back(dynamic_cast<AdditionalLibOption&>($1).StringTokenRef());
}
else if ($1.getSymbolName() == "AdditionalDefinesOption")
{
o.m_saAddDefs.push_back(dynamic_cast<AdditionalDefinesOption&>($1).StringTokenRef());
}
else if ($1.getSymbolName() == "BuildTargetDirOption")
{
universal::File& f = dynamic_cast<BuildTargetDirOption&>($1).ForceDirectoryTokenRef();
o.m_sTargetDir = f.name();
}
else if ($1.getSymbolName() == "TestCommandOption")
{
o.m_sTestCmd = dynamic_cast<TestCommandOption&>($1).QuoteOrStringTokenRef();
}
}}
BuildConfigurationName ::= ('debug'|'release')
{{
/* If the keyword is followed by something that is not a space char
* the parsing must be rejected.
*/
if (! isspace($0.stream().peek()))
{
reject();
}
else
{
set(#1);
}
}}
| string
{{
error(cout, $1.getLineNo(), "invalid build configuration '%s' specified", $1.str());
}}
This file is part of the LLOOP Reversible Object-Oriented Parser Generator. Copyright (c) 2005-2006 Michel MEHL, France. All rights reserved. LLOOP is distributed by the company ERSA SaRL.
| Copyright (c) 2005-2006 Michel MEHL, Haguenau, France |
| LLOOP version 1.1 |