| LLOOP Index | GSP Language | GSP Library | Framework Classes | Component Classes |
This is the verbatim text of the file "gspc_arguments.gsp" part of the LLOOP package. The copyright remains with Michel MEHL. All rights reserved.
import file;
import quoteorstring;
symbol GrammarFileOption implements option(
"Grammar file(s)",
"",
"Generates code from the specified grammar file(s)",
"",
existingfile) ;
symbol GspPathOption implements option(
"Grammar path(s)",
"--gsp-path=<DIRECTORY>",
"Path(s) where to search for imported or external grammars. Subdirectories are NOT examined.",
"--gsp-path",
existingdir) ;
symbol IgnoreCaseOption implements option(
"Generate case-insensitive parser",
"--ignore-case",
"Tells whether to generate a parser that ignores letter case in input stream. Therefore, letter case of constants specified inside the input grammar is not relevant.",
"--ignore-case") ;
symbol AuthorOption implements option(
"Author name",
"--author=<NAME>",
"The name of the author of the input gsp grammar. It is the name that will appear in the file headers of the generated files along with the copyright notice. Providing an author name is optional.",
"--author",
quote_or_string);
symbol LicenseFileOption implements option(
"License file",
"--license-file=<FILE>",
"Path to the license file",
"--license-file",
existingfile) ;
symbol CPPOptionSet implements optionset(
"C++ Generation Option Set",
"C++ Generation Option Set",
gspc_arguments_cpp.ArgumentCPP) ;
symbol TCLOptionSet implements optionset(
"TCL Entry Panel Option Set",
"TCL Entry Panel Option Set",
gspc_arguments_tcl.ArgumentTCL) ;
symbol SubProjectsOption implements option(
"Sub-project file(s)",
"--sub-project",
"Sub-project(s) on which to perform user actions.\n\nThis option is used by and useful for GFE applications only. The gspc compiler does not handle this argument.",
"--sub-project",
existingfile) ;
symbol LicenseFileOption occurs at most once;
symbol AuthorOption occurs at most once;
symbol IgnoreCaseOption occurs at most once;
/* symbol LicenseFileOption occurs once; */
/* license file should be mandatory but since it is possible to give arguments
* by either command line or configuration file, it should be optional here
* and checked manually by the application
*/
/* There can be several GspPathOption */
/* There can be several GrammarFileOption */
/* The values of the options are actually stored in member variables
* of the extended 'OptionsData' class.
*/
symbol Arguments extends class OptionsData()
include
"OptionsData.h",
"gspc_arguments_cpp__ArgumentCPP.h",
"gspc_arguments_tcl__ArgumentTCL.h",
"gspc_arguments__ExistingDirectoryToken.h",
"gspc_arguments__ExistingFileToken.h",
"gspc_arguments__QuoteOrStringToken.h"
test
{{
"arguments for building gspc v1.1, with an invalid source file specified": fail {gspc.gsp gspc_arguments.gsp gspc_arguments_cpp.gsp gspc_arguments_make.gsp gspc_license.gsp gspc_rc.gsp --gsp-path=../../gsp --author="Michel MEHL" --license-file=../../license/license --make-exe --platform=all --build-cfg=debug --silent-make --cpp-file=GSPCCompiler.cpp --cpp-lib=pthread --make-define=REENTRANT --h-dir=. --cpp-dir=. --obj-dir=. --template-dir=../../templates --editor=emacs --editor=kedit --tcl-dir=tcl --tcl-options-control-panel}
"arguments for building gspc v1.1, with all source files missing": fail {gspc.gsp gspc_arguments.gsp gspc_arguments_cpp.gsp gspc_arguments_make.gsp gspc_license.gsp gspc_rc.gsp --gsp-path=../../gsp --author="Michel MEHL" --license-file=../../license/license --make-exe --platform=all --build-cfg=debug --silent-make --cpp-file=md5.c --cpp-file=ProCrypt.cpp --cpp-file=ProCRC.cpp --cpp-file=Preproc.cpp --cpp-file=OptionsData.cpp --cpp-file=GSymbol.cpp --cpp-file=Grammar.cpp --cpp-file=LLGrammarTranslator.cpp --cpp-file=GSPCCompiler.cpp --cpp-lib=pthread --make-define=REENTRANT --h-dir=. --cpp-dir=. --obj-dir=. --template-dir=../../templates --editor=emacs --editor=kedit --tcl-dir=tcl --tcl-options-control-panel}
"arguments for building gspc v1.1, with additional template directory and no additional source files specified": pass {gspc.gsp gspc_arguments.gsp gspc_arguments_cpp.gsp gspc_arguments_make.gsp gspc_license.gsp gspc_rc.gsp --gsp-path=../../gsp --author="Michel MEHL" --license-file=../../license/license --make-exe --platform=all --build-cfg=debug --silent-make --cpp-lib=pthread --make-define=REENTRANT --h-dir=. --cpp-dir=. --obj-dir=. --template-dir=../../templates --editor=emacs --editor=kedit --tcl-dir=tcl --tcl-options-control-panel}
"arguments for building gspc v1.1 without additional source files": pass {gspc.gsp gspc_arguments.gsp gspc_arguments_cpp.gsp gspc_arguments_make.gsp gspc_license.gsp gspc_rc.gsp --gsp-path=../../gsp --author="Michel MEHL" --license-file=../../license/license --make-exe --platform=all --build-cfg=debug --silent-make --cpp-lib=pthread --make-define=REENTRANT --h-dir=. --cpp-dir=. --obj-dir=. --template-dir=../../templates --editor=emacs --editor=kedit --tcl-dir=tcl --tcl-options-control-panel}
}};
Arguments ::= { Argument } {{ }}
Argument ::= ( GspPathOption | AuthorOption | IgnoreCaseOption | LicenseFileOption | CPPOptionSet | TCLOptionSet | SubProjectsOption | GrammarFileOption )
{{
if ($1.getSymbolName() == "CPPOptionSet")
{
$0.root().completeWith(dynamic_cast<CPPOptionSet&>($1).gspc_arguments_cpp__ArgumentCPPRef());
}
else if ($1.getSymbolName() == "TCLOptionSet")
{
$0.root().completeWith(dynamic_cast<TCLOptionSet&>($1).gspc_arguments_tcl__ArgumentTCLRef());
}
else if ($1.getSymbolName() == "AuthorOption")
{
$0.root().m_sAuthor = dynamic_cast<AuthorOption&>($1).QuoteOrStringTokenRef();;
}
else if ($1.getSymbolName() == "GspPathOption")
{
$0.root().m_saImportPaths.insert($0.root().m_saImportPaths.begin(),
dynamic_cast<GspPathOption&>($1).ExistingDirectoryTokenRef().absolutePath());
}
else if ($1.getSymbolName() == "LicenseFileOption")
{
$0.root().m_sLicenseFile = dynamic_cast<LicenseFileOption&>($1).ExistingFileTokenRef().absolutePath();
}
else if ($1.getSymbolName() == "IgnoreCaseOption")
{
$0.root().m_bIgnoreCase = true;
}
else if ($1.getSymbolName() == "GrammarFileOption")
{
$0.root().m_saGspFileNames.push_back(dynamic_cast<GrammarFileOption&>($1).ExistingFileTokenRef().absolutePath());
}
}}
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 |