summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-07-28 14:08:37 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-07-28 14:08:37 (GMT)
commit24dd88d156c9c5dcca1ac6b07fa6e67502a4132b (patch)
treee38ab2d8e67f005bfcaff84781d46e642c19e39c
parentdce1b2991c58f583a6d038dbef1cb4b92307829f (diff)
parentecca8fd90806158dd61f769bd7882e7ee73f3f48 (diff)
downloadCMake-24dd88d156c9c5dcca1ac6b07fa6e67502a4132b.zip
CMake-24dd88d156c9c5dcca1ac6b07fa6e67502a4132b.tar.gz
CMake-24dd88d156c9c5dcca1ac6b07fa6e67502a4132b.tar.bz2
Merge topic 'fortran-parser-updates'
ecca8fd9 cmFortranParser: Port to bison 3 eebe732b cmFortranParser: Factor out of cmDependsFortran fd194458 cmDependsFortran: Simplify storage of preprocessor definitions 295480b9 cmDependsFortran: Move FindIncludeFile method into parser class 98b9645b Rename Fortran parser infrastructure to drop "Depends" prefix 096dd3c9 cmDependsFortranLexer: Remove trailing blank line
-rw-r--r--Source/CMakeLists.txt10
-rw-r--r--Source/cmDependsFortran.cxx512
-rw-r--r--Source/cmDependsFortran.h16
-rw-r--r--Source/cmDependsFortranParser.h96
-rw-r--r--Source/cmFortranLexer.cxx (renamed from Source/cmDependsFortranLexer.cxx)451
-rw-r--r--Source/cmFortranLexer.h (renamed from Source/cmDependsFortranLexer.h)76
-rw-r--r--Source/cmFortranLexer.in.l (renamed from Source/cmDependsFortranLexer.in.l)38
-rw-r--r--Source/cmFortranParser.cxx (renamed from Source/cmDependsFortranParser.cxx)1051
-rw-r--r--Source/cmFortranParser.h175
-rw-r--r--Source/cmFortranParser.y (renamed from Source/cmDependsFortranParser.y)157
-rw-r--r--Source/cmFortranParserImpl.cxx408
-rw-r--r--Source/cmFortranParserTokens.h (renamed from Source/cmDependsFortranParserTokens.h)105
12 files changed, 1461 insertions, 1634 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index d5fe7d1..92fee8a 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -88,7 +88,7 @@ option(CMAKE_REGENERATE_YACCLEX
"Regenerate YACC and LEXX files" OFF)
mark_as_advanced(CMAKE_REGENERATE_YACCLEX)
if(CMAKE_REGENERATE_YACCLEX)
- set(parsersLexers cmDependsFortran cmCommandArgument cmExpr)
+ set(parsersLexers cmFortran cmCommandArgument cmExpr)
find_program(YACC_EXECUTABLE
NAMES yacc bison
PATHS /usr/bin
@@ -193,9 +193,6 @@ set(SRCS
cmDependsC.h
cmDependsFortran.cxx
cmDependsFortran.h
- cmDependsFortranLexer.cxx
- cmDependsFortranParser.cxx
- cmDependsFortranParser.h
cmDependsJava.cxx
cmDependsJava.h
cmDependsJavaLexer.cxx
@@ -243,6 +240,11 @@ set(SRCS
cmFileLockResult.h
cmFileTimeComparison.cxx
cmFileTimeComparison.h
+ cmFortranLexer.cxx
+ cmFortranLexer.h
+ cmFortranParser.cxx
+ cmFortranParser.h
+ cmFortranParserImpl.cxx
cmGeneratedFileStream.cxx
cmGeneratorExpressionContext.cxx
cmGeneratorExpressionContext.h
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 1b2586c..13c6409 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -16,84 +16,15 @@
#include "cmMakefile.h"
#include "cmGeneratedFileStream.h"
-#include "cmDependsFortranParser.h" /* Interface to parser object. */
+#include "cmFortranParser.h" /* Interface to parser object. */
#include <cmsys/FStream.hxx>
#include <assert.h>
-#include <stack>
// TODO: Test compiler for the case of the mod file. Some always
// use lower case and some always use upper case. I do not know if any
// use the case from the source code.
//----------------------------------------------------------------------------
-// Information about a single source file.
-class cmDependsFortranSourceInfo
-{
-public:
- // The name of the source file.
- std::string Source;
-
- // Set of provided and required modules.
- std::set<std::string> Provides;
- std::set<std::string> Requires;
-
- // Set of files included in the translation unit.
- std::set<std::string> Includes;
-};
-
-//----------------------------------------------------------------------------
-// Parser methods not included in generated interface.
-
-// Get the current buffer processed by the lexer.
-YY_BUFFER_STATE cmDependsFortranLexer_GetCurrentBuffer(yyscan_t yyscanner);
-
-// The parser entry point.
-int cmDependsFortran_yyparse(yyscan_t);
-
-//----------------------------------------------------------------------------
-// Define parser object internal structure.
-struct cmDependsFortranFile
-{
- cmDependsFortranFile(FILE* file, YY_BUFFER_STATE buffer,
- const std::string& dir):
- File(file), Buffer(buffer), Directory(dir) {}
- FILE* File;
- YY_BUFFER_STATE Buffer;
- std::string Directory;
-};
-
-struct cmDependsFortranParser_s
-{
- cmDependsFortranParser_s(cmDependsFortran* self,
- std::set<std::string>& ppDefines,
- cmDependsFortranSourceInfo& info);
- ~cmDependsFortranParser_s();
-
- // Pointer back to the main class.
- cmDependsFortran* Self;
-
- // Lexical scanner instance.
- yyscan_t Scanner;
-
- // Stack of open files in the translation unit.
- std::stack<cmDependsFortranFile> FileStack;
-
- // Buffer for string literals.
- std::string TokenString;
-
- // Flag for whether lexer is reading from inside an interface.
- bool InInterface;
-
- int OldStartcond;
- std::set<std::string> PPDefinitions;
- size_t InPPFalseBranch;
- std::stack<bool> SkipToEnd;
-
- // Information about the parsed source.
- cmDependsFortranSourceInfo& Info;
-};
-
-//----------------------------------------------------------------------------
class cmDependsFortranInternals
{
public:
@@ -105,18 +36,18 @@ public:
TargetRequiresMap TargetRequires;
// Information about each object file.
- typedef std::map<std::string, cmDependsFortranSourceInfo> ObjectInfoMap;
+ typedef std::map<std::string, cmFortranSourceInfo> ObjectInfoMap;
ObjectInfoMap ObjectInfo;
- cmDependsFortranSourceInfo& CreateObjectInfo(const char* obj,
+ cmFortranSourceInfo& CreateObjectInfo(const char* obj,
const char* src)
{
- std::map<std::string, cmDependsFortranSourceInfo>::iterator i =
+ std::map<std::string, cmFortranSourceInfo>::iterator i =
this->ObjectInfo.find(obj);
if(i == this->ObjectInfo.end())
{
- std::map<std::string, cmDependsFortranSourceInfo>::value_type
- entry(obj, cmDependsFortranSourceInfo());
+ std::map<std::string, cmFortranSourceInfo>::value_type
+ entry(obj, cmFortranSourceInfo());
i = this->ObjectInfo.insert(entry).first;
i->second.Source = src;
}
@@ -126,7 +57,7 @@ public:
//----------------------------------------------------------------------------
cmDependsFortran::cmDependsFortran():
- PPDefinitions(0), Internal(0)
+ Internal(0)
{
}
@@ -159,7 +90,7 @@ cmDependsFortran
{
def = it->substr(0, assignment);
}
- this->PPDefinitions.push_back(def);
+ this->PPDefinitions.insert(def);
}
}
@@ -192,22 +123,18 @@ bool cmDependsFortran::WriteDependencies(
{
const std::string& src = *it;
// Get the information object for this source.
- cmDependsFortranSourceInfo& info =
+ cmFortranSourceInfo& info =
this->Internal->CreateObjectInfo(obj.c_str(), src.c_str());
- // Make a copy of the macros defined via ADD_DEFINITIONS
- std::set<std::string> ppDefines(this->PPDefinitions.begin(),
- this->PPDefinitions.end());
-
- // Create the parser object. The constructor takes ppMacro and info per
- // reference, so we may look into the resulting objects later.
- cmDependsFortranParser parser(this, ppDefines, info);
+ // Create the parser object. The constructor takes info by reference,
+ // so we may look into the resulting objects later.
+ cmFortranParser parser(this->IncludePath, this->PPDefinitions, info);
// Push on the starting file.
- cmDependsFortranParser_FilePush(&parser, src.c_str());
+ cmFortranParser_FilePush(&parser, src.c_str());
// Parse the translation unit.
- if(cmDependsFortran_yyparse(parser.Scanner) != 0)
+ if(cmFortran_yyparse(parser.Scanner) != 0)
{
// Failed to parse the file. Report failure to write dependencies.
okay = false;
@@ -318,7 +245,7 @@ void cmDependsFortran::LocateModules()
for(ObjectInfoMap::const_iterator infoI = objInfo.begin();
infoI != objInfo.end(); ++infoI)
{
- cmDependsFortranSourceInfo const& info = infoI->second;
+ cmFortranSourceInfo const& info = infoI->second;
// Include this module in the set provided by this target.
this->Internal->TargetProvides.insert(info.Provides.begin(),
info.Provides.end());
@@ -428,7 +355,7 @@ void cmDependsFortran::ConsiderModule(const char* name,
bool
cmDependsFortran
::WriteDependenciesReal(const char *obj,
- cmDependsFortranSourceInfo const& info,
+ cmFortranSourceInfo const& info,
const char* mod_dir, const char* stamp_dir,
std::ostream& makeDepends,
std::ostream& internalDepends)
@@ -701,7 +628,7 @@ bool cmDependsFortran::CopyModule(const std::vector<std::string>& args)
// is later used for longer sequences it should be re-written using an
// efficient string search algorithm such as Boyer-Moore.
static
-bool cmDependsFortranStreamContainsSequence(std::istream& ifs,
+bool cmFortranStreamContainsSequence(std::istream& ifs,
const char* seq, int len)
{
assert(len > 0);
@@ -734,7 +661,7 @@ bool cmDependsFortranStreamContainsSequence(std::istream& ifs,
//----------------------------------------------------------------------------
// Helper function to compare the remaining content in two streams.
-static bool cmDependsFortranStreamsDiffer(std::istream& ifs1,
+static bool cmFortranStreamsDiffer(std::istream& ifs1,
std::istream& ifs2)
{
// Compare the remaining content.
@@ -837,7 +764,7 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
const char seq[1] = {'\n'};
const int seqlen = 1;
- if(!cmDependsFortranStreamContainsSequence(finModFile, seq, seqlen))
+ if(!cmFortranStreamContainsSequence(finModFile, seq, seqlen))
{
// The module is of unexpected format. Assume it is different.
std::cerr << compilerId << " fortran module " << modFile
@@ -845,7 +772,7 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
return true;
}
- if(!cmDependsFortranStreamContainsSequence(finStampFile, seq, seqlen))
+ if(!cmFortranStreamContainsSequence(finStampFile, seq, seqlen))
{
// The stamp must differ if the sequence is not contained.
return true;
@@ -857,7 +784,7 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
const char seq[2] = {'\n', '\0'};
const int seqlen = 2;
- if(!cmDependsFortranStreamContainsSequence(finModFile, seq, seqlen))
+ if(!cmFortranStreamContainsSequence(finModFile, seq, seqlen))
{
// The module is of unexpected format. Assume it is different.
std::cerr << compilerId << " fortran module " << modFile
@@ -865,7 +792,7 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
return true;
}
- if(!cmDependsFortranStreamContainsSequence(finStampFile, seq, seqlen))
+ if(!cmFortranStreamContainsSequence(finStampFile, seq, seqlen))
{
// The stamp must differ if the sequence is not contained.
return true;
@@ -875,7 +802,7 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
// Compare the remaining content. If no compiler id matched above,
// including the case none was given, this will compare the whole
// content.
- if(!cmDependsFortranStreamsDiffer(finModFile, finStampFile))
+ if(!cmFortranStreamsDiffer(finModFile, finStampFile))
{
return false;
}
@@ -883,396 +810,3 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
// The modules are different.
return true;
}
-
-//----------------------------------------------------------------------------
-bool cmDependsFortran::FindIncludeFile(const char* dir,
- const char* includeName,
- std::string& fileName)
-{
- // If the file is a full path, include it directly.
- if(cmSystemTools::FileIsFullPath(includeName))
- {
- fileName = includeName;
- return cmSystemTools::FileExists(fileName.c_str(), true);
- }
- else
- {
- // Check for the file in the directory containing the including
- // file.
- std::string fullName = dir;
- fullName += "/";
- fullName += includeName;
- if(cmSystemTools::FileExists(fullName.c_str(), true))
- {
- fileName = fullName;
- return true;
- }
-
- // Search the include path for the file.
- for(std::vector<std::string>::const_iterator i =
- this->IncludePath.begin(); i != this->IncludePath.end(); ++i)
- {
- fullName = *i;
- fullName += "/";
- fullName += includeName;
- if(cmSystemTools::FileExists(fullName.c_str(), true))
- {
- fileName = fullName;
- return true;
- }
- }
- }
- return false;
-}
-
-//----------------------------------------------------------------------------
-cmDependsFortranParser_s
-::cmDependsFortranParser_s(cmDependsFortran* self,
- std::set<std::string>& ppDefines,
- cmDependsFortranSourceInfo& info):
- Self(self), PPDefinitions(ppDefines), Info(info)
-{
- this->InInterface = 0;
- this->InPPFalseBranch = 0;
-
- // Initialize the lexical scanner.
- cmDependsFortran_yylex_init(&this->Scanner);
- cmDependsFortran_yyset_extra(this, this->Scanner);
-
- // Create a dummy buffer that is never read but is the fallback
- // buffer when the last file is popped off the stack.
- YY_BUFFER_STATE buffer =
- cmDependsFortran_yy_create_buffer(0, 4, this->Scanner);
- cmDependsFortran_yy_switch_to_buffer(buffer, this->Scanner);
-}
-
-//----------------------------------------------------------------------------
-cmDependsFortranParser_s::~cmDependsFortranParser_s()
-{
- cmDependsFortran_yylex_destroy(this->Scanner);
-}
-
-//----------------------------------------------------------------------------
-bool cmDependsFortranParser_FilePush(cmDependsFortranParser* parser,
- const char* fname)
-{
- // Open the new file and push it onto the stack. Save the old
- // buffer with it on the stack.
- if(FILE* file = cmsys::SystemTools::Fopen(fname, "rb"))
- {
- YY_BUFFER_STATE current =
- cmDependsFortranLexer_GetCurrentBuffer(parser->Scanner);
- std::string dir = cmSystemTools::GetParentDirectory(fname);
- cmDependsFortranFile f(file, current, dir);
- YY_BUFFER_STATE buffer =
- cmDependsFortran_yy_create_buffer(0, 16384, parser->Scanner);
- cmDependsFortran_yy_switch_to_buffer(buffer, parser->Scanner);
- parser->FileStack.push(f);
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-//----------------------------------------------------------------------------
-bool cmDependsFortranParser_FilePop(cmDependsFortranParser* parser)
-{
- // Pop one file off the stack and close it. Switch the lexer back
- // to the next one on the stack.
- if(parser->FileStack.empty())
- {
- return 0;
- }
- else
- {
- cmDependsFortranFile f = parser->FileStack.top(); parser->FileStack.pop();
- fclose(f.File);
- YY_BUFFER_STATE current =
- cmDependsFortranLexer_GetCurrentBuffer(parser->Scanner);
- cmDependsFortran_yy_delete_buffer(current, parser->Scanner);
- cmDependsFortran_yy_switch_to_buffer(f.Buffer, parser->Scanner);
- return 1;
- }
-}
-
-//----------------------------------------------------------------------------
-int cmDependsFortranParser_Input(cmDependsFortranParser* parser,
- char* buffer, size_t bufferSize)
-{
- // Read from the file on top of the stack. If the stack is empty,
- // the end of the translation unit has been reached.
- if(!parser->FileStack.empty())
- {
- FILE* file = parser->FileStack.top().File;
- return (int)fread(buffer, 1, bufferSize, file);
- }
- return 0;
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_StringStart(cmDependsFortranParser* parser)
-{
- parser->TokenString = "";
-}
-
-//----------------------------------------------------------------------------
-const char* cmDependsFortranParser_StringEnd(cmDependsFortranParser* parser)
-{
- return parser->TokenString.c_str();
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_StringAppend(cmDependsFortranParser* parser,
- char c)
-{
- parser->TokenString += c;
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_SetInInterface(cmDependsFortranParser* parser,
- bool in)
-{
- if(parser->InPPFalseBranch)
- {
- return;
- }
-
- parser->InInterface = in;
-}
-
-//----------------------------------------------------------------------------
-bool cmDependsFortranParser_GetInInterface(cmDependsFortranParser* parser)
-{
- return parser->InInterface;
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_SetOldStartcond(cmDependsFortranParser* parser,
- int arg)
-{
- parser->OldStartcond = arg;
-}
-
-//----------------------------------------------------------------------------
-int cmDependsFortranParser_GetOldStartcond(cmDependsFortranParser* parser)
-{
- return parser->OldStartcond;
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_Error(cmDependsFortranParser*, const char*)
-{
- // If there is a parser error just ignore it. The source will not
- // compile and the user will edit it. Then dependencies will have
- // to be regenerated anyway.
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_RuleUse(cmDependsFortranParser* parser,
- const char* name)
-{
- if(!parser->InPPFalseBranch)
- {
- parser->Info.Requires.insert(cmSystemTools::LowerCase(name) );
- }
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_RuleInclude(cmDependsFortranParser* parser,
- const char* name)
-{
- if(parser->InPPFalseBranch)
- {
- return;
- }
-
- // If processing an include statement there must be an open file.
- assert(!parser->FileStack.empty());
-
- // Get the directory containing the source in which the include
- // statement appears. This is always the first search location for
- // Fortran include files.
- std::string dir = parser->FileStack.top().Directory;
-
- // Find the included file. If it cannot be found just ignore the
- // problem because either the source will not compile or the user
- // does not care about depending on this included source.
- std::string fullName;
- if(parser->Self->FindIncludeFile(dir.c_str(), name, fullName))
- {
- // Found the included file. Save it in the set of included files.
- parser->Info.Includes.insert(fullName);
-
- // Parse it immediately to translate the source inline.
- cmDependsFortranParser_FilePush(parser, fullName.c_str());
- }
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_RuleModule(cmDependsFortranParser* parser,
- const char* name)
-{
- if(!parser->InPPFalseBranch && !parser->InInterface)
- {
- parser->Info.Provides.insert(cmSystemTools::LowerCase(name));
- }
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_RuleDefine(cmDependsFortranParser* parser,
- const char* macro)
-{
- if(!parser->InPPFalseBranch)
- {
- parser->PPDefinitions.insert(macro);
- }
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_RuleUndef(cmDependsFortranParser* parser,
- const char* macro)
-{
- if(!parser->InPPFalseBranch)
- {
- std::set<std::string>::iterator match;
- match = parser->PPDefinitions.find(macro);
- if(match != parser->PPDefinitions.end())
- {
- parser->PPDefinitions.erase(match);
- }
- }
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_RuleIfdef(cmDependsFortranParser* parser,
- const char* macro)
-{
- // A new PP branch has been opened
- parser->SkipToEnd.push(false);
-
- if (parser->InPPFalseBranch)
- {
- parser->InPPFalseBranch++;
- }
- else if(parser->PPDefinitions.find(macro) == parser->PPDefinitions.end())
- {
- parser->InPPFalseBranch=1;
- }
- else
- {
- parser->SkipToEnd.top() = true;
- }
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_RuleIfndef(cmDependsFortranParser* parser,
- const char* macro)
-{
- // A new PP branch has been opened
- parser->SkipToEnd.push(false);
-
- if (parser->InPPFalseBranch)
- {
- parser->InPPFalseBranch++;
- }
- else if(parser->PPDefinitions.find(macro) != parser->PPDefinitions.end())
- {
- parser->InPPFalseBranch = 1;
- }
- else
- {
- // ignore other branches
- parser->SkipToEnd.top() = true;
- }
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_RuleIf(cmDependsFortranParser* parser)
-{
- /* Note: The current parser is _not_ able to get statements like
- * #if 0
- * #if 1
- * #if MYSMBOL
- * #if defined(MYSYMBOL)
- * #if defined(MYSYMBOL) && ...
- * right. The same for #elif. Thus in
- * #if SYMBOL_1
- * ..
- * #elif SYMBOL_2
- * ...
- * ...
- * #elif SYMBOL_N
- * ..
- * #else
- * ..
- * #endif
- * _all_ N+1 branches are considered. If you got something like this
- * #if defined(MYSYMBOL)
- * #if !defined(MYSYMBOL)
- * use
- * #ifdef MYSYMBOL
- * #ifndef MYSYMBOL
- * instead.
- */
-
- // A new PP branch has been opened
- // Never skip! See note above.
- parser->SkipToEnd.push(false);
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_RuleElif(cmDependsFortranParser* parser)
-{
- /* Note: There are parser limitations. See the note at
- * cmDependsFortranParser_RuleIf(..)
- */
-
- // Always taken unless an #ifdef or #ifndef-branch has been taken
- // already. If the second condition isn't meet already
- // (parser->InPPFalseBranch == 0) correct it.
- if(!parser->SkipToEnd.empty() &&
- parser->SkipToEnd.top() && !parser->InPPFalseBranch)
- {
- parser->InPPFalseBranch = 1;
- }
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_RuleElse(cmDependsFortranParser* parser)
-{
- // if the parent branch is false do nothing!
- if(parser->InPPFalseBranch > 1)
- {
- return;
- }
-
- // parser->InPPFalseBranch is either 0 or 1. We change it depending on
- // parser->SkipToEnd.top()
- if(!parser->SkipToEnd.empty() &&
- parser->SkipToEnd.top())
- {
- parser->InPPFalseBranch = 1;
- }
- else
- {
- parser->InPPFalseBranch = 0;
- }
-}
-
-//----------------------------------------------------------------------------
-void cmDependsFortranParser_RuleEndif(cmDependsFortranParser* parser)
-{
- if(!parser->SkipToEnd.empty())
- {
- parser->SkipToEnd.pop();
- }
-
- // #endif doesn't know if there was a "#else" in before, so it
- // always decreases InPPFalseBranch
- if(parser->InPPFalseBranch)
- {
- parser->InPPFalseBranch--;
- }
-}
diff --git a/Source/cmDependsFortran.h b/Source/cmDependsFortran.h
index cb40796..d6ec7d7 100644
--- a/Source/cmDependsFortran.h
+++ b/Source/cmDependsFortran.h
@@ -9,13 +9,13 @@
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
-#ifndef cmDependsFortran_h
-#define cmDependsFortran_h
+#ifndef cmFortran_h
+#define cmFortran_h
#include "cmDepends.h"
class cmDependsFortranInternals;
-class cmDependsFortranSourceInfo;
+class cmFortranSourceInfo;
/** \class cmDependsFortran
* \brief Dependency scanner for Fortran object files.
@@ -46,12 +46,6 @@ public:
static bool ModulesDiffer(const char* modFile, const char* stampFile,
const char* compilerId);
- /** Method to find an included file in the include path. Fortran
- always searches the directory containing the including source
- first. */
- bool FindIncludeFile(const char* dir, const char* includeName,
- std::string& fileName);
-
protected:
// Finalize the dependency information for the target.
virtual bool Finalize(std::ostream& makeDepends,
@@ -71,7 +65,7 @@ protected:
// Actually write the depenencies to the streams.
bool WriteDependenciesReal(const char *obj,
- cmDependsFortranSourceInfo const& info,
+ cmFortranSourceInfo const& info,
const char* mod_dir, const char* stamp_dir,
std::ostream& makeDepends,
std::ostream& internalDepends);
@@ -79,7 +73,7 @@ protected:
// The source file from which to start scanning.
std::string SourceFile;
- std::vector<std::string> PPDefinitions;
+ std::set<std::string> PPDefinitions;
// Internal implementation details.
cmDependsFortranInternals* Internal;
diff --git a/Source/cmDependsFortranParser.h b/Source/cmDependsFortranParser.h
deleted file mode 100644
index 399c3c8..0000000
--- a/Source/cmDependsFortranParser.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*============================================================================
- CMake - Cross Platform Makefile Generator
- Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
- Distributed under the OSI-approved BSD License (the "License");
- see accompanying file Copyright.txt for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License for more information.
-============================================================================*/
-#ifndef cmDependsFortranParser_h
-#define cmDependsFortranParser_h
-
-#include <stddef.h> /* size_t */
-
-/* Forward declare parser object type. */
-typedef struct cmDependsFortranParser_s cmDependsFortranParser;
-
-/* Functions to enter/exit #include'd files in order. */
-bool cmDependsFortranParser_FilePush(cmDependsFortranParser* parser,
- const char* fname);
-bool cmDependsFortranParser_FilePop(cmDependsFortranParser* parser);
-
-/* Callbacks for lexer. */
-int cmDependsFortranParser_Input(cmDependsFortranParser* parser,
- char* buffer, size_t bufferSize);
-
-
-void cmDependsFortranParser_StringStart(cmDependsFortranParser* parser);
-const char* cmDependsFortranParser_StringEnd(cmDependsFortranParser* parser);
-void cmDependsFortranParser_StringAppend(cmDependsFortranParser* parser,
- char c);
-
-void cmDependsFortranParser_SetInInterface(cmDependsFortranParser* parser,
- bool is_in);
-bool cmDependsFortranParser_GetInInterface(cmDependsFortranParser* parser);
-
-
-void cmDependsFortranParser_SetInPPFalseBranch(cmDependsFortranParser* parser,
- bool is_in);
-bool cmDependsFortranParser_GetInPPFalseBranch(cmDependsFortranParser* parser);
-
-
-void cmDependsFortranParser_SetOldStartcond(cmDependsFortranParser* parser,
- int arg);
-int cmDependsFortranParser_GetOldStartcond(cmDependsFortranParser* parser);
-
-/* Callbacks for parser. */
-void cmDependsFortranParser_Error(cmDependsFortranParser* parser,
- const char* message);
-void cmDependsFortranParser_RuleUse(cmDependsFortranParser* parser,
- const char* name);
-void cmDependsFortranParser_RuleInclude(cmDependsFortranParser* parser,
- const char* name);
-void cmDependsFortranParser_RuleModule(cmDependsFortranParser* parser,
- const char* name);
-void cmDependsFortranParser_RuleDefine(cmDependsFortranParser* parser,
- const char* name);
-void cmDependsFortranParser_RuleUndef(cmDependsFortranParser* parser,
- const char* name);
-void cmDependsFortranParser_RuleIfdef(cmDependsFortranParser* parser,
- const char* name);
-void cmDependsFortranParser_RuleIfndef(cmDependsFortranParser* parser,
- const char* name);
-void cmDependsFortranParser_RuleIf(cmDependsFortranParser* parser);
-void cmDependsFortranParser_RuleElif(cmDependsFortranParser* parser);
-void cmDependsFortranParser_RuleElse(cmDependsFortranParser* parser);
-void cmDependsFortranParser_RuleEndif(cmDependsFortranParser* parser);
-
-/* Define the parser stack element type. */
-typedef union cmDependsFortran_yystype_u cmDependsFortran_yystype;
-union cmDependsFortran_yystype_u
-{
- char* string;
-};
-
-/* Setup the proper yylex interface. */
-#define YY_EXTRA_TYPE cmDependsFortranParser*
-#define YY_DECL \
-int cmDependsFortran_yylex(YYSTYPE* yylvalp, yyscan_t yyscanner)
-#define YYSTYPE cmDependsFortran_yystype
-#define YYSTYPE_IS_DECLARED 1
-#if !defined(cmDependsFortranLexer_cxx)
-# include "cmDependsFortranLexer.h"
-#endif
-#if !defined(cmDependsFortranLexer_cxx)
-#if !defined(cmDependsFortranParser_cxx)
-# undef YY_EXTRA_TYPE
-# undef YY_DECL
-# undef YYSTYPE
-# undef YYSTYPE_IS_DECLARED
-#endif
-#endif
-
-#endif
diff --git a/Source/cmDependsFortranLexer.cxx b/Source/cmFortranLexer.cxx
index 1eff1e4..b727f0e 100644
--- a/Source/cmDependsFortranLexer.cxx
+++ b/Source/cmFortranLexer.cxx
@@ -9,9 +9,9 @@
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
-#line 2 "cmDependsFortranLexer.cxx"
+#line 2 "cmFortranLexer.cxx"
-#line 4 "cmDependsFortranLexer.cxx"
+#line 4 "cmFortranLexer.cxx"
#define YY_INT_ALIGNED short int
@@ -164,7 +164,7 @@ typedef void* yyscan_t;
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE cmDependsFortran_yyrestart(yyin ,yyscanner )
+#define YY_NEW_FILE cmFortran_yyrestart(yyin ,yyscanner )
#define YY_END_OF_BUFFER_CHAR 0
@@ -274,7 +274,7 @@ struct yy_buffer_state
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via cmDependsFortran_yyrestart()), so that the user can continue scanning by
+ * (via cmFortran_yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
@@ -297,36 +297,36 @@ struct yy_buffer_state
*/
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
-void cmDependsFortran_yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void cmDependsFortran_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsFortran_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void cmDependsFortran_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmDependsFortran_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmDependsFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void cmDependsFortran_yypop_buffer_state (yyscan_t yyscanner );
+void cmFortran_yyrestart (FILE *input_file ,yyscan_t yyscanner );
+void cmFortran_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+YY_BUFFER_STATE cmFortran_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
+void cmFortran_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void cmFortran_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void cmFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+void cmFortran_yypop_buffer_state (yyscan_t yyscanner );
-static void cmDependsFortran_yyensure_buffer_stack (yyscan_t yyscanner );
-static void cmDependsFortran_yy_load_buffer_state (yyscan_t yyscanner );
-static void cmDependsFortran_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
+static void cmFortran_yyensure_buffer_stack (yyscan_t yyscanner );
+static void cmFortran_yy_load_buffer_state (yyscan_t yyscanner );
+static void cmFortran_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
-#define YY_FLUSH_BUFFER cmDependsFortran_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
+#define YY_FLUSH_BUFFER cmFortran_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
-YY_BUFFER_STATE cmDependsFortran_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsFortran_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsFortran_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE cmFortran_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
+YY_BUFFER_STATE cmFortran_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
+YY_BUFFER_STATE cmFortran_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
-void *cmDependsFortran_yyalloc (yy_size_t ,yyscan_t yyscanner );
-void *cmDependsFortran_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void cmDependsFortran_yyfree (void * ,yyscan_t yyscanner );
+void *cmFortran_yyalloc (yy_size_t ,yyscan_t yyscanner );
+void *cmFortran_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
+void cmFortran_yyfree (void * ,yyscan_t yyscanner );
-#define yy_new_buffer cmDependsFortran_yy_create_buffer
+#define yy_new_buffer cmFortran_yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
- cmDependsFortran_yyensure_buffer_stack (yyscanner); \
+ cmFortran_yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- cmDependsFortran_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ cmFortran_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
@@ -334,9 +334,9 @@ void cmDependsFortran_yyfree (void * ,yyscan_t yyscanner );
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
- cmDependsFortran_yyensure_buffer_stack (yyscanner); \
+ cmFortran_yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- cmDependsFortran_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ cmFortran_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
@@ -345,7 +345,7 @@ void cmDependsFortran_yyfree (void * ,yyscan_t yyscanner );
/* Begin user sect3 */
-#define cmDependsFortran_yywrap(n) 1
+#define cmFortran_yywrap(n) 1
#define YY_SKIP_YYWRAP
typedef unsigned char YY_CHAR;
@@ -622,8 +622,8 @@ static yyconst flex_int16_t yy_chk[547] =
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-#line 1 "cmDependsFortranLexer.in.l"
-#line 2 "cmDependsFortranLexer.in.l"
+#line 1 "cmFortranLexer.in.l"
+#line 2 "cmFortranLexer.in.l"
/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
@@ -651,17 +651,17 @@ This file must be translated to C and modified to build everywhere.
Run flex like this:
- flex -i --prefix=cmDependsFortran_yy --header-file=cmDependsFortranLexer.h -ocmDependsFortranLexer.cxx cmDependsFortranLexer.in.l
+ flex -i --prefix=cmFortran_yy --header-file=cmFortranLexer.h -ocmFortranLexer.cxx cmFortranLexer.in.l
-Modify cmDependsFortranLexer.cxx:
+Modify cmFortranLexer.cxx:
- remove TABs
- remove "yyscanner" argument from these methods:
- yy_fatal_error, cmDependsFortran_yyalloc, cmDependsFortran_yyrealloc, cmDependsFortran_yyfree
- - remove "yyscanner = NULL" from end of cmDependsFortran_yylex_destroy
+ yy_fatal_error, cmFortran_yyalloc, cmFortran_yyrealloc, cmFortran_yyfree
+ - remove "yyscanner = NULL" from end of cmFortran_yylex_destroy
- remove all YY_BREAK lines occurring right after return statements
- change while ( 1 ) to for(;;)
-Modify cmDependsFortranLexer.h:
+Modify cmFortranLexer.h:
- remove TABs
- remove the yy_init_globals function
- remove the block that includes unistd.h
@@ -671,21 +671,21 @@ Modify cmDependsFortranLexer.h:
#include "cmStandardLexer.h"
-#define cmDependsFortranLexer_cxx
-#include "cmDependsFortranParser.h" /* Interface to parser object. */
+#define cmFortranLexer_cxx
+#include "cmFortranParser.h" /* Interface to parser object. */
/* Replace the lexer input function. */
#undef YY_INPUT
#define YY_INPUT(buf, result, max_size) \
- { result = cmDependsFortranParser_Input(yyextra, buf, max_size); }
+ { result = cmFortranParser_Input(yyextra, buf, max_size); }
/* Include the set of tokens from the parser. */
-#include "cmDependsFortranParserTokens.h"
+#include "cmFortranParserTokens.h"
/*--------------------------------------------------------------------------*/
-#line 678 "cmDependsFortranLexer.cxx"
+#line 678 "cmFortranLexer.cxx"
#define INITIAL 0
#define free_fmt 1
@@ -741,38 +741,38 @@ struct yyguts_t
static int yy_init_globals (yyscan_t yyscanner );
-int cmDependsFortran_yylex_init (yyscan_t* scanner);
+int cmFortran_yylex_init (yyscan_t* scanner);
-int cmDependsFortran_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int cmFortran_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int cmDependsFortran_yylex_destroy (yyscan_t yyscanner );
+int cmFortran_yylex_destroy (yyscan_t yyscanner );
-int cmDependsFortran_yyget_debug (yyscan_t yyscanner );
+int cmFortran_yyget_debug (yyscan_t yyscanner );
-void cmDependsFortran_yyset_debug (int debug_flag ,yyscan_t yyscanner );
+void cmFortran_yyset_debug (int debug_flag ,yyscan_t yyscanner );
-YY_EXTRA_TYPE cmDependsFortran_yyget_extra (yyscan_t yyscanner );
+YY_EXTRA_TYPE cmFortran_yyget_extra (yyscan_t yyscanner );
-void cmDependsFortran_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+void cmFortran_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
-FILE *cmDependsFortran_yyget_in (yyscan_t yyscanner );
+FILE *cmFortran_yyget_in (yyscan_t yyscanner );
-void cmDependsFortran_yyset_in (FILE * in_str ,yyscan_t yyscanner );
+void cmFortran_yyset_in (FILE * in_str ,yyscan_t yyscanner );
-FILE *cmDependsFortran_yyget_out (yyscan_t yyscanner );
+FILE *cmFortran_yyget_out (yyscan_t yyscanner );
-void cmDependsFortran_yyset_out (FILE * out_str ,yyscan_t yyscanner );
+void cmFortran_yyset_out (FILE * out_str ,yyscan_t yyscanner );
-int cmDependsFortran_yyget_leng (yyscan_t yyscanner );
+int cmFortran_yyget_leng (yyscan_t yyscanner );
-char *cmDependsFortran_yyget_text (yyscan_t yyscanner );
+char *cmFortran_yyget_text (yyscan_t yyscanner );
-int cmDependsFortran_yyget_lineno (yyscan_t yyscanner );
+int cmFortran_yyget_lineno (yyscan_t yyscanner );
-void cmDependsFortran_yyset_lineno (int line_number ,yyscan_t yyscanner );
+void cmFortran_yyset_lineno (int line_number ,yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -780,9 +780,9 @@ void cmDependsFortran_yyset_lineno (int line_number ,yyscan_t yyscanner );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int cmDependsFortran_yywrap (yyscan_t yyscanner );
+extern "C" int cmFortran_yywrap (yyscan_t yyscanner );
#else
-extern int cmDependsFortran_yywrap (yyscan_t yyscanner );
+extern int cmFortran_yywrap (yyscan_t yyscanner );
#endif
#endif
@@ -886,9 +886,9 @@ static int input (yyscan_t yyscanner );
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int cmDependsFortran_yylex (yyscan_t yyscanner);
+extern int cmFortran_yylex (yyscan_t yyscanner);
-#define YY_DECL int cmDependsFortran_yylex (yyscan_t yyscanner)
+#define YY_DECL int cmFortran_yylex (yyscan_t yyscanner)
#endif /* !YY_DECL */
/* Code executed at the beginning of each rule, after yytext and yyleng
@@ -918,10 +918,10 @@ YY_DECL
int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-#line 71 "cmDependsFortranLexer.in.l"
+#line 71 "cmFortranLexer.in.l"
-#line 914 "cmDependsFortranLexer.cxx"
+#line 914 "cmFortranLexer.cxx"
if ( !yyg->yy_init )
{
@@ -941,12 +941,12 @@ YY_DECL
yyout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
- cmDependsFortran_yyensure_buffer_stack (yyscanner);
+ cmFortran_yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- cmDependsFortran_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ cmFortran_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
}
- cmDependsFortran_yy_load_buffer_state(yyscanner );
+ cmFortran_yy_load_buffer_state(yyscanner );
}
for(;;) /* loops until end-of-file is reached */
@@ -1007,47 +1007,47 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 73 "cmDependsFortranLexer.in.l"
+#line 73 "cmFortranLexer.in.l"
{
- cmDependsFortranParser_StringStart(yyextra);
- cmDependsFortranParser_SetOldStartcond(yyextra, YY_START);
+ cmFortranParser_StringStart(yyextra);
+ cmFortranParser_SetOldStartcond(yyextra, YY_START);
BEGIN(str_dq);
}
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 79 "cmDependsFortranLexer.in.l"
+#line 79 "cmFortranLexer.in.l"
{
- cmDependsFortranParser_StringStart(yyextra);
- cmDependsFortranParser_SetOldStartcond(yyextra, YY_START);
+ cmFortranParser_StringStart(yyextra);
+ cmFortranParser_SetOldStartcond(yyextra, YY_START);
BEGIN(str_sq);
}
YY_BREAK
case 3:
-#line 86 "cmDependsFortranLexer.in.l"
+#line 86 "cmFortranLexer.in.l"
case 4:
YY_RULE_SETUP
-#line 86 "cmDependsFortranLexer.in.l"
+#line 86 "cmFortranLexer.in.l"
{
- BEGIN(cmDependsFortranParser_GetOldStartcond(yyextra) );
- yylvalp->string = strdup(cmDependsFortranParser_StringEnd(yyextra));
+ BEGIN(cmFortranParser_GetOldStartcond(yyextra) );
+ yylvalp->string = strdup(cmFortranParser_StringEnd(yyextra));
return STRING;
}
case 5:
/* rule 5 can match eol */
-#line 93 "cmDependsFortranLexer.in.l"
+#line 93 "cmFortranLexer.in.l"
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
-#line 93 "cmDependsFortranLexer.in.l"
+#line 93 "cmFortranLexer.in.l"
/* Ignore (continued strings, free fmt) */
YY_BREAK
case 7:
/* rule 7 can match eol */
YY_RULE_SETUP
-#line 95 "cmDependsFortranLexer.in.l"
+#line 95 "cmFortranLexer.in.l"
{
- if (cmDependsFortranParser_GetOldStartcond(yyextra) == fixed_fmt)
+ if (cmFortranParser_GetOldStartcond(yyextra) == fixed_fmt)
; /* Ignore (cont. strings, fixed fmt) */
else
{
@@ -1058,7 +1058,7 @@ YY_RULE_SETUP
case 8:
/* rule 8 can match eol */
YY_RULE_SETUP
-#line 105 "cmDependsFortranLexer.in.l"
+#line 105 "cmFortranLexer.in.l"
{
unput ('\n');
BEGIN(INITIAL);
@@ -1066,25 +1066,25 @@ YY_RULE_SETUP
}
case 9:
YY_RULE_SETUP
-#line 111 "cmDependsFortranLexer.in.l"
+#line 111 "cmFortranLexer.in.l"
{
- cmDependsFortranParser_StringAppend(yyextra, yytext[0]);
+ cmFortranParser_StringAppend(yyextra, yytext[0]);
}
YY_BREAK
case 10:
/* rule 10 can match eol */
YY_RULE_SETUP
-#line 115 "cmDependsFortranLexer.in.l"
+#line 115 "cmFortranLexer.in.l"
{ return EOSTMT; } /* Treat comments like */
case 11:
/* rule 11 can match eol */
YY_RULE_SETUP
-#line 116 "cmDependsFortranLexer.in.l"
+#line 116 "cmFortranLexer.in.l"
{ return EOSTMT; } /* empty lines */
case 12:
/* rule 12 can match eol */
YY_RULE_SETUP
-#line 118 "cmDependsFortranLexer.in.l"
+#line 118 "cmFortranLexer.in.l"
{
yytext[yyleng-1] = 0;
yylvalp->string = strdup(strchr(yytext, '<')+1);
@@ -1092,149 +1092,149 @@ YY_RULE_SETUP
}
case 13:
YY_RULE_SETUP
-#line 123 "cmDependsFortranLexer.in.l"
+#line 123 "cmFortranLexer.in.l"
{ return CPP_INCLUDE; }
case 14:
YY_RULE_SETUP
-#line 124 "cmDependsFortranLexer.in.l"
+#line 124 "cmFortranLexer.in.l"
{ return F90PPR_INCLUDE; }
case 15:
YY_RULE_SETUP
-#line 125 "cmDependsFortranLexer.in.l"
+#line 125 "cmFortranLexer.in.l"
{ return COCO_INCLUDE; }
case 16:
YY_RULE_SETUP
-#line 127 "cmDependsFortranLexer.in.l"
+#line 127 "cmFortranLexer.in.l"
{ return CPP_DEFINE; }
case 17:
YY_RULE_SETUP
-#line 128 "cmDependsFortranLexer.in.l"
+#line 128 "cmFortranLexer.in.l"
{ return F90PPR_DEFINE; }
case 18:
YY_RULE_SETUP
-#line 130 "cmDependsFortranLexer.in.l"
+#line 130 "cmFortranLexer.in.l"
{ return CPP_UNDEF; }
case 19:
YY_RULE_SETUP
-#line 131 "cmDependsFortranLexer.in.l"
+#line 131 "cmFortranLexer.in.l"
{ return F90PPR_UNDEF; }
case 20:
YY_RULE_SETUP
-#line 133 "cmDependsFortranLexer.in.l"
+#line 133 "cmFortranLexer.in.l"
{ return CPP_IFDEF; }
case 21:
YY_RULE_SETUP
-#line 134 "cmDependsFortranLexer.in.l"
+#line 134 "cmFortranLexer.in.l"
{ return CPP_IFNDEF; }
case 22:
YY_RULE_SETUP
-#line 135 "cmDependsFortranLexer.in.l"
+#line 135 "cmFortranLexer.in.l"
{ return CPP_IF; }
case 23:
YY_RULE_SETUP
-#line 136 "cmDependsFortranLexer.in.l"
+#line 136 "cmFortranLexer.in.l"
{ return CPP_ELIF; }
case 24:
YY_RULE_SETUP
-#line 137 "cmDependsFortranLexer.in.l"
+#line 137 "cmFortranLexer.in.l"
{ return CPP_ELSE; }
case 25:
YY_RULE_SETUP
-#line 138 "cmDependsFortranLexer.in.l"
+#line 138 "cmFortranLexer.in.l"
{ return CPP_ENDIF; }
case 26:
YY_RULE_SETUP
-#line 140 "cmDependsFortranLexer.in.l"
+#line 140 "cmFortranLexer.in.l"
{ return F90PPR_IFDEF; }
case 27:
YY_RULE_SETUP
-#line 141 "cmDependsFortranLexer.in.l"
+#line 141 "cmFortranLexer.in.l"
{ return F90PPR_IFNDEF; }
case 28:
YY_RULE_SETUP
-#line 142 "cmDependsFortranLexer.in.l"
+#line 142 "cmFortranLexer.in.l"
{ return F90PPR_IF; }
case 29:
YY_RULE_SETUP
-#line 143 "cmDependsFortranLexer.in.l"
+#line 143 "cmFortranLexer.in.l"
{ return F90PPR_ELIF; }
case 30:
YY_RULE_SETUP
-#line 144 "cmDependsFortranLexer.in.l"
+#line 144 "cmFortranLexer.in.l"
{ return F90PPR_ELSE; }
case 31:
YY_RULE_SETUP
-#line 145 "cmDependsFortranLexer.in.l"
+#line 145 "cmFortranLexer.in.l"
{ return F90PPR_ENDIF; }
/* Line continuations, possible involving comments. */
case 32:
/* rule 32 can match eol */
YY_RULE_SETUP
-#line 148 "cmDependsFortranLexer.in.l"
+#line 148 "cmFortranLexer.in.l"
YY_BREAK
case 33:
/* rule 33 can match eol */
YY_RULE_SETUP
-#line 149 "cmDependsFortranLexer.in.l"
+#line 149 "cmFortranLexer.in.l"
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 151 "cmDependsFortranLexer.in.l"
+#line 151 "cmFortranLexer.in.l"
{ return COMMA; }
case 35:
YY_RULE_SETUP
-#line 153 "cmDependsFortranLexer.in.l"
+#line 153 "cmFortranLexer.in.l"
{ return DCOLON; }
case 36:
/* rule 36 can match eol */
YY_RULE_SETUP
-#line 155 "cmDependsFortranLexer.in.l"
+#line 155 "cmFortranLexer.in.l"
{ return GARBAGE; }
case 37:
YY_RULE_SETUP
-#line 157 "cmDependsFortranLexer.in.l"
+#line 157 "cmFortranLexer.in.l"
{ return ASSIGNMENT_OP; }
case 38:
YY_RULE_SETUP
-#line 159 "cmDependsFortranLexer.in.l"
+#line 159 "cmFortranLexer.in.l"
{
yylvalp->string = strdup(yytext);
return WORD;
}
case 39:
YY_RULE_SETUP
-#line 164 "cmDependsFortranLexer.in.l"
+#line 164 "cmFortranLexer.in.l"
{ return GARBAGE; }
case 40:
/* rule 40 can match eol */
YY_RULE_SETUP
-#line 166 "cmDependsFortranLexer.in.l"
+#line 166 "cmFortranLexer.in.l"
{ return EOSTMT; }
case 41:
YY_RULE_SETUP
-#line 169 "cmDependsFortranLexer.in.l"
+#line 169 "cmFortranLexer.in.l"
/* Ignore */
YY_BREAK
case 42:
/* rule 42 can match eol */
YY_RULE_SETUP
-#line 170 "cmDependsFortranLexer.in.l"
+#line 170 "cmFortranLexer.in.l"
/* Ignore line-endings preceeded by \ */
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 172 "cmDependsFortranLexer.in.l"
+#line 172 "cmFortranLexer.in.l"
{ return *yytext; }
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(free_fmt):
case YY_STATE_EOF(fixed_fmt):
case YY_STATE_EOF(str_sq):
case YY_STATE_EOF(str_dq):
-#line 174 "cmDependsFortranLexer.in.l"
+#line 174 "cmFortranLexer.in.l"
{
- if(!cmDependsFortranParser_FilePop(yyextra) )
+ if(!cmFortranParser_FilePop(yyextra) )
{
return YY_NULL;
}
@@ -1242,10 +1242,10 @@ case YY_STATE_EOF(str_dq):
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 181 "cmDependsFortranLexer.in.l"
+#line 181 "cmFortranLexer.in.l"
ECHO;
YY_BREAK
-#line 1270 "cmDependsFortranLexer.cxx"
+#line 1270 "cmFortranLexer.cxx"
case YY_END_OF_BUFFER:
{
@@ -1261,7 +1261,7 @@ ECHO;
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed yyin at a new source and called
- * cmDependsFortran_yylex(). If so, then we have to assure
+ * cmFortran_yylex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
@@ -1321,7 +1321,7 @@ ECHO;
{
yyg->yy_did_buffer_switch_on_eof = 0;
- if ( cmDependsFortran_yywrap(yyscanner ) )
+ if ( cmFortran_yywrap(yyscanner ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
@@ -1374,7 +1374,7 @@ ECHO;
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
-} /* end of cmDependsFortran_yylex */
+} /* end of cmFortran_yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
@@ -1453,7 +1453,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- cmDependsFortran_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+ cmFortran_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
}
else
/* Can't grow it, we don't own it. */
@@ -1485,7 +1485,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- cmDependsFortran_yyrestart(yyin ,yyscanner);
+ cmFortran_yyrestart(yyin ,yyscanner);
}
else
@@ -1502,7 +1502,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cmDependsFortran_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cmFortran_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
}
@@ -1656,13 +1656,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
*/
/* Reset buffer status. */
- cmDependsFortran_yyrestart(yyin ,yyscanner);
+ cmFortran_yyrestart(yyin ,yyscanner);
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( cmDependsFortran_yywrap(yyscanner ) )
+ if ( cmFortran_yywrap(yyscanner ) )
return EOF;
if ( ! yyg->yy_did_buffer_switch_on_eof )
@@ -1696,34 +1696,34 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @note This function does not reset the start condition to @c INITIAL .
*/
- void cmDependsFortran_yyrestart (FILE * input_file , yyscan_t yyscanner)
+ void cmFortran_yyrestart (FILE * input_file , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! YY_CURRENT_BUFFER ){
- cmDependsFortran_yyensure_buffer_stack (yyscanner);
+ cmFortran_yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- cmDependsFortran_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ cmFortran_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
}
- cmDependsFortran_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
- cmDependsFortran_yy_load_buffer_state(yyscanner );
+ cmFortran_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
+ cmFortran_yy_load_buffer_state(yyscanner );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
* @param yyscanner The scanner object.
*/
- void cmDependsFortran_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+ void cmFortran_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* TODO. We should be able to replace this entire function body
* with
- * cmDependsFortran_yypop_buffer_state();
- * cmDependsFortran_yypush_buffer_state(new_buffer);
+ * cmFortran_yypop_buffer_state();
+ * cmFortran_yypush_buffer_state(new_buffer);
*/
- cmDependsFortran_yyensure_buffer_stack (yyscanner);
+ cmFortran_yyensure_buffer_stack (yyscanner);
if ( YY_CURRENT_BUFFER == new_buffer )
return;
@@ -1736,17 +1736,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- cmDependsFortran_yy_load_buffer_state(yyscanner );
+ cmFortran_yy_load_buffer_state(yyscanner );
/* We don't actually know whether we did this switch during
- * EOF (cmDependsFortran_yywrap()) processing, but the only time this flag
- * is looked at is after cmDependsFortran_yywrap() is called, so it's safe
+ * EOF (cmFortran_yywrap()) processing, but the only time this flag
+ * is looked at is after cmFortran_yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yyg->yy_did_buffer_switch_on_eof = 1;
}
-static void cmDependsFortran_yy_load_buffer_state (yyscan_t yyscanner)
+static void cmFortran_yy_load_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
@@ -1761,35 +1761,35 @@ static void cmDependsFortran_yy_load_buffer_state (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the allocated buffer state.
*/
- YY_BUFFER_STATE cmDependsFortran_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
+ YY_BUFFER_STATE cmFortran_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) cmDependsFortran_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) cmFortran_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in cmDependsFortran_yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in cmFortran_yy_create_buffer()" );
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) cmDependsFortran_yyalloc(b->yy_buf_size + 2 ,yyscanner );
+ b->yy_ch_buf = (char *) cmFortran_yyalloc(b->yy_buf_size + 2 ,yyscanner );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in cmDependsFortran_yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in cmFortran_yy_create_buffer()" );
b->yy_is_our_buffer = 1;
- cmDependsFortran_yy_init_buffer(b,file ,yyscanner);
+ cmFortran_yy_init_buffer(b,file ,yyscanner);
return b;
}
/** Destroy the buffer.
- * @param b a buffer created with cmDependsFortran_yy_create_buffer()
+ * @param b a buffer created with cmFortran_yy_create_buffer()
* @param yyscanner The scanner object.
*/
- void cmDependsFortran_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void cmFortran_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -1800,9 +1800,9 @@ static void cmDependsFortran_yy_load_buffer_state (yyscan_t yyscanner)
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- cmDependsFortran_yyfree((void *) b->yy_ch_buf ,yyscanner );
+ cmFortran_yyfree((void *) b->yy_ch_buf ,yyscanner );
- cmDependsFortran_yyfree((void *) b ,yyscanner );
+ cmFortran_yyfree((void *) b ,yyscanner );
}
#ifndef __cplusplus
@@ -1811,21 +1811,21 @@ extern int isatty (int );
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
- * such as during a cmDependsFortran_yyrestart() or at EOF.
+ * such as during a cmFortran_yyrestart() or at EOF.
*/
- static void cmDependsFortran_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
+ static void cmFortran_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
{
int oerrno = errno;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- cmDependsFortran_yy_flush_buffer(b ,yyscanner);
+ cmFortran_yy_flush_buffer(b ,yyscanner);
b->yy_input_file = file;
b->yy_fill_buffer = 1;
- /* If b is the current buffer, then cmDependsFortran_yy_init_buffer was _probably_
- * called from cmDependsFortran_yyrestart() or through yy_get_next_buffer.
+ /* If b is the current buffer, then cmFortran_yy_init_buffer was _probably_
+ * called from cmFortran_yyrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
@@ -1842,7 +1842,7 @@ extern int isatty (int );
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
* @param yyscanner The scanner object.
*/
- void cmDependsFortran_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void cmFortran_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! b )
@@ -1863,7 +1863,7 @@ extern int isatty (int );
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
- cmDependsFortran_yy_load_buffer_state(yyscanner );
+ cmFortran_yy_load_buffer_state(yyscanner );
}
/** Pushes the new state onto the stack. The new state becomes
@@ -1872,15 +1872,15 @@ extern int isatty (int );
* @param new_buffer The new state.
* @param yyscanner The scanner object.
*/
-void cmDependsFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+void cmFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (new_buffer == NULL)
return;
- cmDependsFortran_yyensure_buffer_stack(yyscanner);
+ cmFortran_yyensure_buffer_stack(yyscanner);
- /* This block is copied from cmDependsFortran_yy_switch_to_buffer. */
+ /* This block is copied from cmFortran_yy_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
@@ -1894,8 +1894,8 @@ void cmDependsFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t
yyg->yy_buffer_stack_top++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from cmDependsFortran_yy_switch_to_buffer. */
- cmDependsFortran_yy_load_buffer_state(yyscanner );
+ /* copied from cmFortran_yy_switch_to_buffer. */
+ cmFortran_yy_load_buffer_state(yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
@@ -1903,19 +1903,19 @@ void cmDependsFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t
* The next element becomes the new top.
* @param yyscanner The scanner object.
*/
-void cmDependsFortran_yypop_buffer_state (yyscan_t yyscanner)
+void cmFortran_yypop_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!YY_CURRENT_BUFFER)
return;
- cmDependsFortran_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+ cmFortran_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
YY_CURRENT_BUFFER_LVALUE = NULL;
if (yyg->yy_buffer_stack_top > 0)
--yyg->yy_buffer_stack_top;
if (YY_CURRENT_BUFFER) {
- cmDependsFortran_yy_load_buffer_state(yyscanner );
+ cmFortran_yy_load_buffer_state(yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
}
@@ -1923,7 +1923,7 @@ void cmDependsFortran_yypop_buffer_state (yyscan_t yyscanner)
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
-static void cmDependsFortran_yyensure_buffer_stack (yyscan_t yyscanner)
+static void cmFortran_yyensure_buffer_stack (yyscan_t yyscanner)
{
int num_to_alloc;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -1935,11 +1935,11 @@ static void cmDependsFortran_yyensure_buffer_stack (yyscan_t yyscanner)
* immediate realloc on the next call.
*/
num_to_alloc = 1;
- yyg->yy_buffer_stack = (struct yy_buffer_state**)cmDependsFortran_yyalloc
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)cmFortran_yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in cmDependsFortran_yyensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in cmFortran_yyensure_buffer_stack()" );
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
@@ -1954,12 +1954,12 @@ static void cmDependsFortran_yyensure_buffer_stack (yyscan_t yyscanner)
int grow_size = 8 /* arbitrary grow size */;
num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
- yyg->yy_buffer_stack = (struct yy_buffer_state**)cmDependsFortran_yyrealloc
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)cmFortran_yyrealloc
(yyg->yy_buffer_stack,
num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in cmDependsFortran_yyensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in cmFortran_yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -1973,7 +1973,7 @@ static void cmDependsFortran_yyensure_buffer_stack (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE cmDependsFortran_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
+YY_BUFFER_STATE cmFortran_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
@@ -1983,9 +1983,9 @@ YY_BUFFER_STATE cmDependsFortran_yy_scan_buffer (char * base, yy_size_t size ,
/* They forgot to leave room for the EOB's. */
return 0;
- b = (YY_BUFFER_STATE) cmDependsFortran_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) cmFortran_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in cmDependsFortran_yy_scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in cmFortran_yy_scan_buffer()" );
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
@@ -1997,33 +1997,33 @@ YY_BUFFER_STATE cmDependsFortran_yy_scan_buffer (char * base, yy_size_t size ,
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- cmDependsFortran_yy_switch_to_buffer(b ,yyscanner );
+ cmFortran_yy_switch_to_buffer(b ,yyscanner );
return b;
}
-/** Setup the input buffer state to scan a string. The next call to cmDependsFortran_yylex() will
+/** Setup the input buffer state to scan a string. The next call to cmFortran_yylex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
- * cmDependsFortran_yy_scan_bytes() instead.
+ * cmFortran_yy_scan_bytes() instead.
*/
-YY_BUFFER_STATE cmDependsFortran_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
+YY_BUFFER_STATE cmFortran_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
{
- return cmDependsFortran_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
+ return cmFortran_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
}
-/** Setup the input buffer state to scan the given bytes. The next call to cmDependsFortran_yylex() will
+/** Setup the input buffer state to scan the given bytes. The next call to cmFortran_yylex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE cmDependsFortran_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE cmFortran_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
@@ -2032,18 +2032,18 @@ YY_BUFFER_STATE cmDependsFortran_yy_scan_bytes (yyconst char * yybytes, int _y
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
- buf = (char *) cmDependsFortran_yyalloc(n ,yyscanner );
+ buf = (char *) cmFortran_yyalloc(n ,yyscanner );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in cmDependsFortran_yy_scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in cmFortran_yy_scan_bytes()" );
for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = cmDependsFortran_yy_scan_buffer(buf,n ,yyscanner);
+ b = cmFortran_yy_scan_buffer(buf,n ,yyscanner);
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in cmDependsFortran_yy_scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in cmFortran_yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
@@ -2085,7 +2085,7 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t)
/** Get the user-defined data for this scanner.
* @param yyscanner The scanner object.
*/
-YY_EXTRA_TYPE cmDependsFortran_yyget_extra (yyscan_t yyscanner)
+YY_EXTRA_TYPE cmFortran_yyget_extra (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyextra;
@@ -2094,7 +2094,7 @@ YY_EXTRA_TYPE cmDependsFortran_yyget_extra (yyscan_t yyscanner)
/** Get the current line number.
* @param yyscanner The scanner object.
*/
-int cmDependsFortran_yyget_lineno (yyscan_t yyscanner)
+int cmFortran_yyget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -2107,7 +2107,7 @@ int cmDependsFortran_yyget_lineno (yyscan_t yyscanner)
/** Get the current column number.
* @param yyscanner The scanner object.
*/
-int cmDependsFortran_yyget_column (yyscan_t yyscanner)
+int cmFortran_yyget_column (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -2120,7 +2120,7 @@ int cmDependsFortran_yyget_column (yyscan_t yyscanner)
/** Get the input stream.
* @param yyscanner The scanner object.
*/
-FILE *cmDependsFortran_yyget_in (yyscan_t yyscanner)
+FILE *cmFortran_yyget_in (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyin;
@@ -2129,7 +2129,7 @@ FILE *cmDependsFortran_yyget_in (yyscan_t yyscanner)
/** Get the output stream.
* @param yyscanner The scanner object.
*/
-FILE *cmDependsFortran_yyget_out (yyscan_t yyscanner)
+FILE *cmFortran_yyget_out (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyout;
@@ -2138,7 +2138,7 @@ FILE *cmDependsFortran_yyget_out (yyscan_t yyscanner)
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
-int cmDependsFortran_yyget_leng (yyscan_t yyscanner)
+int cmFortran_yyget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
@@ -2148,7 +2148,7 @@ int cmDependsFortran_yyget_leng (yyscan_t yyscanner)
* @param yyscanner The scanner object.
*/
-char *cmDependsFortran_yyget_text (yyscan_t yyscanner)
+char *cmFortran_yyget_text (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yytext;
@@ -2158,7 +2158,7 @@ char *cmDependsFortran_yyget_text (yyscan_t yyscanner)
* @param user_defined The data to be associated with this scanner.
* @param yyscanner The scanner object.
*/
-void cmDependsFortran_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
+void cmFortran_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyextra = user_defined ;
@@ -2168,13 +2168,13 @@ void cmDependsFortran_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscan
* @param line_number The line number to set.
* @param yyscanner The scanner object.
*/
-void cmDependsFortran_yyset_lineno (int line_number , yyscan_t yyscanner)
+void cmFortran_yyset_lineno (int line_number , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- yy_fatal_error( "cmDependsFortran_yyset_lineno called with no buffer" , yyscanner);
+ yy_fatal_error( "cmFortran_yyset_lineno called with no buffer" , yyscanner);
yylineno = line_number;
}
@@ -2183,13 +2183,13 @@ void cmDependsFortran_yyset_lineno (int line_number , yyscan_t yyscanner)
* @param column_no The column number to set.
* @param yyscanner The scanner object.
*/
-void cmDependsFortran_yyset_column (int column_no , yyscan_t yyscanner)
+void cmFortran_yyset_column (int column_no , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- yy_fatal_error( "cmDependsFortran_yyset_column called with no buffer" , yyscanner);
+ yy_fatal_error( "cmFortran_yyset_column called with no buffer" , yyscanner);
yycolumn = column_no;
}
@@ -2198,27 +2198,27 @@ void cmDependsFortran_yyset_column (int column_no , yyscan_t yyscanner)
* input buffer.
* @param in_str A readable stream.
* @param yyscanner The scanner object.
- * @see cmDependsFortran_yy_switch_to_buffer
+ * @see cmFortran_yy_switch_to_buffer
*/
-void cmDependsFortran_yyset_in (FILE * in_str , yyscan_t yyscanner)
+void cmFortran_yyset_in (FILE * in_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyin = in_str ;
}
-void cmDependsFortran_yyset_out (FILE * out_str , yyscan_t yyscanner)
+void cmFortran_yyset_out (FILE * out_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyout = out_str ;
}
-int cmDependsFortran_yyget_debug (yyscan_t yyscanner)
+int cmFortran_yyget_debug (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yy_flex_debug;
}
-void cmDependsFortran_yyset_debug (int bdebug , yyscan_t yyscanner)
+void cmFortran_yyset_debug (int bdebug , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yy_flex_debug = bdebug ;
@@ -2228,12 +2228,12 @@ void cmDependsFortran_yyset_debug (int bdebug , yyscan_t yyscanner)
/* User-visible API */
-/* cmDependsFortran_yylex_init is special because it creates the scanner itself, so it is
+/* cmFortran_yylex_init is special because it creates the scanner itself, so it is
* the ONLY reentrant function that doesn't take the scanner as the last argument.
* That's why we explicitly handle the declaration, instead of using our macros.
*/
-int cmDependsFortran_yylex_init(yyscan_t* ptr_yy_globals)
+int cmFortran_yylex_init(yyscan_t* ptr_yy_globals)
{
if (ptr_yy_globals == NULL){
@@ -2241,7 +2241,7 @@ int cmDependsFortran_yylex_init(yyscan_t* ptr_yy_globals)
return 1;
}
- *ptr_yy_globals = (yyscan_t) cmDependsFortran_yyalloc ( sizeof( struct yyguts_t ), NULL );
+ *ptr_yy_globals = (yyscan_t) cmFortran_yyalloc ( sizeof( struct yyguts_t ), NULL );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
@@ -2254,27 +2254,27 @@ int cmDependsFortran_yylex_init(yyscan_t* ptr_yy_globals)
return yy_init_globals ( *ptr_yy_globals );
}
-/* cmDependsFortran_yylex_init_extra has the same functionality as cmDependsFortran_yylex_init, but follows the
+/* cmFortran_yylex_init_extra has the same functionality as cmFortran_yylex_init, but follows the
* convention of taking the scanner as the last argument. Note however, that
* this is a *pointer* to a scanner, as it will be allocated by this call (and
* is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to cmDependsFortran_yyalloc in
+ * The user defined value in the first argument will be available to cmFortran_yyalloc in
* the yyextra field.
*/
-int cmDependsFortran_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
+int cmFortran_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
{
struct yyguts_t dummy_yyguts;
- cmDependsFortran_yyset_extra (yy_user_defined, &dummy_yyguts);
+ cmFortran_yyset_extra (yy_user_defined, &dummy_yyguts);
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
- *ptr_yy_globals = (yyscan_t) cmDependsFortran_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+ *ptr_yy_globals = (yyscan_t) cmFortran_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
@@ -2285,7 +2285,7 @@ int cmDependsFortran_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* pt
yy_init_globals. Leave at 0x00 for releases. */
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
- cmDependsFortran_yyset_extra (yy_user_defined, *ptr_yy_globals);
+ cmFortran_yyset_extra (yy_user_defined, *ptr_yy_globals);
return yy_init_globals ( *ptr_yy_globals );
}
@@ -2294,7 +2294,7 @@ static int yy_init_globals (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Initialization is the same as for the non-reentrant scanner.
- * This function is called from cmDependsFortran_yylex_destroy(), so don't allocate here.
+ * This function is called from cmFortran_yylex_destroy(), so don't allocate here.
*/
yyg->yy_buffer_stack = 0;
@@ -2318,37 +2318,37 @@ static int yy_init_globals (yyscan_t yyscanner)
#endif
/* For future reference: Set errno on error, since we are called by
- * cmDependsFortran_yylex_init()
+ * cmFortran_yylex_init()
*/
return 0;
}
-/* cmDependsFortran_yylex_destroy is for both reentrant and non-reentrant scanners. */
-int cmDependsFortran_yylex_destroy (yyscan_t yyscanner)
+/* cmFortran_yylex_destroy is for both reentrant and non-reentrant scanners. */
+int cmFortran_yylex_destroy (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
- cmDependsFortran_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+ cmFortran_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
YY_CURRENT_BUFFER_LVALUE = NULL;
- cmDependsFortran_yypop_buffer_state(yyscanner);
+ cmFortran_yypop_buffer_state(yyscanner);
}
/* Destroy the stack itself. */
- cmDependsFortran_yyfree(yyg->yy_buffer_stack ,yyscanner);
+ cmFortran_yyfree(yyg->yy_buffer_stack ,yyscanner);
yyg->yy_buffer_stack = NULL;
/* Destroy the start condition stack. */
- cmDependsFortran_yyfree(yyg->yy_start_stack ,yyscanner );
+ cmFortran_yyfree(yyg->yy_start_stack ,yyscanner );
yyg->yy_start_stack = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
- * cmDependsFortran_yylex() is called, initialization will occur. */
+ * cmFortran_yylex() is called, initialization will occur. */
yy_init_globals( yyscanner);
/* Destroy the main struct (reentrant only). */
- cmDependsFortran_yyfree ( yyscanner , yyscanner );
+ cmFortran_yyfree ( yyscanner , yyscanner );
return 0;
}
@@ -2376,12 +2376,12 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
}
#endif
-void *cmDependsFortran_yyalloc (yy_size_t size , yyscan_t)
+void *cmFortran_yyalloc (yy_size_t size , yyscan_t)
{
return (void *) malloc( size );
}
-void *cmDependsFortran_yyrealloc (void * ptr, yy_size_t size , yyscan_t)
+void *cmFortran_yyrealloc (void * ptr, yy_size_t size , yyscan_t)
{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
@@ -2393,22 +2393,21 @@ void *cmDependsFortran_yyrealloc (void * ptr, yy_size_t size , yyscan_t)
return (void *) realloc( (char *) ptr, size );
}
-void cmDependsFortran_yyfree (void * ptr , yyscan_t)
+void cmFortran_yyfree (void * ptr , yyscan_t)
{
- free( (char *) ptr ); /* see cmDependsFortran_yyrealloc() for (char *) cast */
+ free( (char *) ptr ); /* see cmFortran_yyrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
-#line 181 "cmDependsFortranLexer.in.l"
+#line 181 "cmFortranLexer.in.l"
/*--------------------------------------------------------------------------*/
-YY_BUFFER_STATE cmDependsFortranLexer_GetCurrentBuffer(yyscan_t yyscanner)
+YY_BUFFER_STATE cmFortranLexer_GetCurrentBuffer(yyscan_t yyscanner)
{
/* Hack into the internal flex-generated scanner to get the buffer. */
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return YY_CURRENT_BUFFER;
}
-
diff --git a/Source/cmDependsFortranLexer.h b/Source/cmFortranLexer.h
index 8e24cfd..c67e332 100644
--- a/Source/cmDependsFortranLexer.h
+++ b/Source/cmFortranLexer.h
@@ -9,9 +9,9 @@
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
-#ifndef cmDependsFortran_yyHEADER_H
-#define cmDependsFortran_yyHEADER_H 1
-#define cmDependsFortran_yyIN_HEADER 1
+#ifndef cmFortran_yyHEADER_H
+#define cmFortran_yyHEADER_H 1
+#define cmFortran_yyIN_HEADER 1
#define YY_INT_ALIGNED short int
@@ -211,25 +211,25 @@ struct yy_buffer_state
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-void cmDependsFortran_yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void cmDependsFortran_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsFortran_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void cmDependsFortran_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmDependsFortran_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmDependsFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void cmDependsFortran_yypop_buffer_state (yyscan_t yyscanner );
+void cmFortran_yyrestart (FILE *input_file ,yyscan_t yyscanner );
+void cmFortran_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+YY_BUFFER_STATE cmFortran_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
+void cmFortran_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void cmFortran_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void cmFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+void cmFortran_yypop_buffer_state (yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsFortran_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsFortran_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsFortran_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE cmFortran_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
+YY_BUFFER_STATE cmFortran_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
+YY_BUFFER_STATE cmFortran_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
-void *cmDependsFortran_yyalloc (yy_size_t ,yyscan_t yyscanner );
-void *cmDependsFortran_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void cmDependsFortran_yyfree (void * ,yyscan_t yyscanner );
+void *cmFortran_yyalloc (yy_size_t ,yyscan_t yyscanner );
+void *cmFortran_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
+void cmFortran_yyfree (void * ,yyscan_t yyscanner );
/* Begin user sect3 */
-#define cmDependsFortran_yywrap(n) 1
+#define cmFortran_yywrap(n) 1
#define YY_SKIP_YYWRAP
#define yytext_ptr yytext_r
@@ -247,38 +247,38 @@ void cmDependsFortran_yyfree (void * ,yyscan_t yyscanner );
#define YY_EXTRA_TYPE void *
#endif
-int cmDependsFortran_yylex_init (yyscan_t* scanner);
+int cmFortran_yylex_init (yyscan_t* scanner);
-int cmDependsFortran_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int cmFortran_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int cmDependsFortran_yylex_destroy (yyscan_t yyscanner );
+int cmFortran_yylex_destroy (yyscan_t yyscanner );
-int cmDependsFortran_yyget_debug (yyscan_t yyscanner );
+int cmFortran_yyget_debug (yyscan_t yyscanner );
-void cmDependsFortran_yyset_debug (int debug_flag ,yyscan_t yyscanner );
+void cmFortran_yyset_debug (int debug_flag ,yyscan_t yyscanner );
-YY_EXTRA_TYPE cmDependsFortran_yyget_extra (yyscan_t yyscanner );
+YY_EXTRA_TYPE cmFortran_yyget_extra (yyscan_t yyscanner );
-void cmDependsFortran_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+void cmFortran_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
-FILE *cmDependsFortran_yyget_in (yyscan_t yyscanner );
+FILE *cmFortran_yyget_in (yyscan_t yyscanner );
-void cmDependsFortran_yyset_in (FILE * in_str ,yyscan_t yyscanner );
+void cmFortran_yyset_in (FILE * in_str ,yyscan_t yyscanner );
-FILE *cmDependsFortran_yyget_out (yyscan_t yyscanner );
+FILE *cmFortran_yyget_out (yyscan_t yyscanner );
-void cmDependsFortran_yyset_out (FILE * out_str ,yyscan_t yyscanner );
+void cmFortran_yyset_out (FILE * out_str ,yyscan_t yyscanner );
-int cmDependsFortran_yyget_leng (yyscan_t yyscanner );
+int cmFortran_yyget_leng (yyscan_t yyscanner );
-char *cmDependsFortran_yyget_text (yyscan_t yyscanner );
+char *cmFortran_yyget_text (yyscan_t yyscanner );
-int cmDependsFortran_yyget_lineno (yyscan_t yyscanner );
+int cmFortran_yyget_lineno (yyscan_t yyscanner );
-void cmDependsFortran_yyset_lineno (int line_number ,yyscan_t yyscanner );
+void cmFortran_yyset_lineno (int line_number ,yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -286,9 +286,9 @@ void cmDependsFortran_yyset_lineno (int line_number ,yyscan_t yyscanner );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int cmDependsFortran_yywrap (yyscan_t yyscanner );
+extern "C" int cmFortran_yywrap (yyscan_t yyscanner );
#else
-extern int cmDependsFortran_yywrap (yyscan_t yyscanner );
+extern int cmFortran_yywrap (yyscan_t yyscanner );
#endif
#endif
@@ -325,9 +325,9 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int cmDependsFortran_yylex (yyscan_t yyscanner);
+extern int cmFortran_yylex (yyscan_t yyscanner);
-#define YY_DECL int cmDependsFortran_yylex (yyscan_t yyscanner)
+#define YY_DECL int cmFortran_yylex (yyscan_t yyscanner)
#endif /* !YY_DECL */
/* yy_get_previous_state - get the state just before the EOB char was reached */
@@ -344,5 +344,5 @@ extern int cmDependsFortran_yylex (yyscan_t yyscanner);
#undef YY_DECL
#endif
-#undef cmDependsFortran_yyIN_HEADER
-#endif /* cmDependsFortran_yyHEADER_H */
+#undef cmFortran_yyIN_HEADER
+#endif /* cmFortran_yyHEADER_H */
diff --git a/Source/cmDependsFortranLexer.in.l b/Source/cmFortranLexer.in.l
index 0148802..03fa90c 100644
--- a/Source/cmDependsFortranLexer.in.l
+++ b/Source/cmFortranLexer.in.l
@@ -26,18 +26,18 @@ This file must be translated to C and modified to build everywhere.
Run flex like this:
- flex -i --prefix=cmDependsFortran_yy --header-file=cmDependsFortranLexer.h -ocmDependsFortranLexer.cxx cmDependsFortranLexer.in.l
+ flex -i --prefix=cmFortran_yy --header-file=cmFortranLexer.h -ocmFortranLexer.cxx cmFortranLexer.in.l
-Modify cmDependsFortranLexer.cxx:
+Modify cmFortranLexer.cxx:
- remove TABs
- remove use of the 'register' storage class specifier
- remove "yyscanner" argument from these methods:
- yy_fatal_error, cmDependsFortran_yyalloc, cmDependsFortran_yyrealloc, cmDependsFortran_yyfree
- - remove "yyscanner = NULL" from end of cmDependsFortran_yylex_destroy
+ yy_fatal_error, cmFortran_yyalloc, cmFortran_yyrealloc, cmFortran_yyfree
+ - remove "yyscanner = NULL" from end of cmFortran_yylex_destroy
- remove all YY_BREAK lines occurring right after return statements
- change while ( 1 ) to for(;;)
-Modify cmDependsFortranLexer.h:
+Modify cmFortranLexer.h:
- remove TABs
- remove the yy_init_globals function
- remove the block that includes unistd.h
@@ -47,16 +47,16 @@ Modify cmDependsFortranLexer.h:
#include "cmStandardLexer.h"
-#define cmDependsFortranLexer_cxx
-#include "cmDependsFortranParser.h" /* Interface to parser object. */
+#define cmFortranLexer_cxx
+#include "cmFortranParser.h" /* Interface to parser object. */
/* Replace the lexer input function. */
#undef YY_INPUT
#define YY_INPUT(buf, result, max_size) \
- { result = cmDependsFortranParser_Input(yyextra, buf, max_size); }
+ { result = cmFortranParser_Input(yyextra, buf, max_size); }
/* Include the set of tokens from the parser. */
-#include "cmDependsFortranParserTokens.h"
+#include "cmFortranParserTokens.h"
/*--------------------------------------------------------------------------*/
%}
@@ -72,21 +72,21 @@ Modify cmDependsFortranLexer.h:
%%
\" {
- cmDependsFortranParser_StringStart(yyextra);
- cmDependsFortranParser_SetOldStartcond(yyextra, YY_START);
+ cmFortranParser_StringStart(yyextra);
+ cmFortranParser_SetOldStartcond(yyextra, YY_START);
BEGIN(str_dq);
}
' {
- cmDependsFortranParser_StringStart(yyextra);
- cmDependsFortranParser_SetOldStartcond(yyextra, YY_START);
+ cmFortranParser_StringStart(yyextra);
+ cmFortranParser_SetOldStartcond(yyextra, YY_START);
BEGIN(str_sq);
}
<str_dq>\" |
<str_sq>' {
- BEGIN(cmDependsFortranParser_GetOldStartcond(yyextra) );
- yylvalp->string = strdup(cmDependsFortranParser_StringEnd(yyextra));
+ BEGIN(cmFortranParser_GetOldStartcond(yyextra) );
+ yylvalp->string = strdup(cmFortranParser_StringEnd(yyextra));
return STRING;
}
@@ -94,7 +94,7 @@ Modify cmDependsFortranLexer.h:
<str_dq,str_sq>&[ \t]*\n[ \t]*& /* Ignore (continued strings, free fmt) */
<fixed_fmt,str_dq,str_sq>\n[ ]{5}[^ \t\n] {
- if (cmDependsFortranParser_GetOldStartcond(yyextra) == fixed_fmt)
+ if (cmFortranParser_GetOldStartcond(yyextra) == fixed_fmt)
; /* Ignore (cont. strings, fixed fmt) */
else
{
@@ -110,7 +110,7 @@ Modify cmDependsFortranLexer.h:
}
<str_sq,str_dq>. {
- cmDependsFortranParser_StringAppend(yyextra, yytext[0]);
+ cmFortranParser_StringAppend(yyextra, yytext[0]);
}
!.*\n { return EOSTMT; } /* Treat comments like */
@@ -173,7 +173,7 @@ $[ \t]*endif { return F90PPR_ENDIF; }
. { return *yytext; }
<<EOF>> {
- if(!cmDependsFortranParser_FilePop(yyextra) )
+ if(!cmFortranParser_FilePop(yyextra) )
{
return YY_NULL;
}
@@ -182,7 +182,7 @@ $[ \t]*endif { return F90PPR_ENDIF; }
%%
/*--------------------------------------------------------------------------*/
-YY_BUFFER_STATE cmDependsFortranLexer_GetCurrentBuffer(yyscan_t yyscanner)
+YY_BUFFER_STATE cmFortranLexer_GetCurrentBuffer(yyscan_t yyscanner)
{
/* Hack into the internal flex-generated scanner to get the buffer. */
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
diff --git a/Source/cmDependsFortranParser.cxx b/Source/cmFortranParser.cxx
index 9d51025..0230f02 100644
--- a/Source/cmDependsFortranParser.cxx
+++ b/Source/cmFortranParser.cxx
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 2.5. */
+/* A Bison parser, made by GNU Bison 3.0.2. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.5"
+#define YYBISON_VERSION "3.0.2"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -58,23 +58,17 @@
/* Pull parsers. */
#define YYPULL 1
-/* Using locations. */
-#define YYLSP_NEEDED 0
/* Substitute the variable and function names. */
-#define yyparse cmDependsFortran_yyparse
-#define yylex cmDependsFortran_yylex
-#define yyerror cmDependsFortran_yyerror
-#define yylval cmDependsFortran_yylval
-#define yychar cmDependsFortran_yychar
-#define yydebug cmDependsFortran_yydebug
-#define yynerrs cmDependsFortran_yynerrs
+#define yyparse cmFortran_yyparse
+#define yylex cmFortran_yylex
+#define yyerror cmFortran_yyerror
+#define yydebug cmFortran_yydebug
+#define yynerrs cmFortran_yynerrs
/* Copy the first part of user declarations. */
-
-/* Line 268 of yacc.c */
-#line 1 "cmDependsFortranParser.y"
+#line 1 "cmFortranParser.y" /* yacc.c:339 */
/*============================================================================
CMake - Cross Platform Makefile Generator
@@ -103,41 +97,33 @@ This file must be translated to C and modified to build everywhere.
Run bison like this:
- bison --yacc --name-prefix=cmDependsFortran_yy
- --defines=cmDependsFortranParserTokens.h
- -ocmDependsFortranParser.cxx
- cmDependsFortranParser.y
+ bison --yacc --name-prefix=cmFortran_yy
+ --defines=cmFortranParserTokens.h
+ -ocmFortranParser.cxx
+ cmFortranParser.y
-Modify cmDependsFortranParser.cxx:
- - remove TABs
- - Remove the yyerrorlab block in range ["goto yyerrlab1", "yyerrlab1:"]
+Modify cmFortranParser.cxx:
+ - "#if 0" out yyerrorlab block in range ["goto yyerrlab1", "yyerrlab1:"]
*/
/*-------------------------------------------------------------------------*/
-#define cmDependsFortranParser_cxx
-#include "cmDependsFortranParser.h" /* Interface to parser object. */
-#include "cmDependsFortranParserTokens.h" /* Need YYSTYPE for YY_DECL. */
+#define cmFortranParser_cxx
+#include "cmFortranParser.h" /* Interface to parser object. */
+#include "cmFortranParserTokens.h" /* Need YYSTYPE for YY_DECL. */
#include <cmsys/String.h>
-/* Configure the parser to use a lexer object. */
-#define YYPARSE_PARAM yyscanner
-#define YYLEX_PARAM yyscanner
-#define YYERROR_VERBOSE 1
-#define cmDependsFortran_yyerror(x) \
- cmDependsFortranError(yyscanner, x)
-
/* Forward declare the lexer entry point. */
YY_DECL;
-/* Helper function to forward error callback. */
-static void cmDependsFortranError(yyscan_t yyscanner, const char* message)
+/* Helper function to forward error callback from parser. */
+static void cmFortran_yyerror(yyscan_t yyscanner, const char* message)
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_Error(parser, message);
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_Error(parser, message);
}
-static bool cmDependsFortranParserIsKeyword(const char* word,
+static bool cmFortranParserIsKeyword(const char* word,
const char* keyword)
{
return cmsysString_strcasecmp(word, keyword) == 0;
@@ -153,65 +139,71 @@ static bool cmDependsFortranParserIsKeyword(const char* word,
# pragma warning (disable: 4244) /* Conversion to smaller type, data loss. */
#endif
+#line 143 "cmFortranParser.cxx" /* yacc.c:339 */
-/* Line 268 of yacc.c */
-#line 165 "cmDependsFortranParser.cxx"
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
+# ifndef YY_NULLPTR
+# if defined __cplusplus && 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
+# endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
-# define YYERROR_VERBOSE 0
+# define YYERROR_VERBOSE 1
#endif
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
+/* In a future release of Bison, this section will be replaced
+ by #include "cmFortranParserTokens.h". */
+#ifndef YY_CMFORTRAN_YY_CMFORTRANPARSERTOKENS_H_INCLUDED
+# define YY_CMFORTRAN_YY_CMFORTRANPARSERTOKENS_H_INCLUDED
+/* Debug traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int cmFortran_yydebug;
#endif
-
-/* Tokens. */
+/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- EOSTMT = 258,
- ASSIGNMENT_OP = 259,
- GARBAGE = 260,
- CPP_INCLUDE = 261,
- F90PPR_INCLUDE = 262,
- COCO_INCLUDE = 263,
- F90PPR_DEFINE = 264,
- CPP_DEFINE = 265,
- F90PPR_UNDEF = 266,
- CPP_UNDEF = 267,
- CPP_IFDEF = 268,
- CPP_IFNDEF = 269,
- CPP_IF = 270,
- CPP_ELSE = 271,
- CPP_ELIF = 272,
- CPP_ENDIF = 273,
- F90PPR_IFDEF = 274,
- F90PPR_IFNDEF = 275,
- F90PPR_IF = 276,
- F90PPR_ELSE = 277,
- F90PPR_ELIF = 278,
- F90PPR_ENDIF = 279,
- COMMA = 280,
- DCOLON = 281,
- CPP_TOENDL = 282,
- UNTERMINATED_STRING = 283,
- STRING = 284,
- WORD = 285,
- CPP_INCLUDE_ANGLE = 286
- };
+ enum yytokentype
+ {
+ EOSTMT = 258,
+ ASSIGNMENT_OP = 259,
+ GARBAGE = 260,
+ CPP_INCLUDE = 261,
+ F90PPR_INCLUDE = 262,
+ COCO_INCLUDE = 263,
+ F90PPR_DEFINE = 264,
+ CPP_DEFINE = 265,
+ F90PPR_UNDEF = 266,
+ CPP_UNDEF = 267,
+ CPP_IFDEF = 268,
+ CPP_IFNDEF = 269,
+ CPP_IF = 270,
+ CPP_ELSE = 271,
+ CPP_ELIF = 272,
+ CPP_ENDIF = 273,
+ F90PPR_IFDEF = 274,
+ F90PPR_IFNDEF = 275,
+ F90PPR_IF = 276,
+ F90PPR_ELSE = 277,
+ F90PPR_ELIF = 278,
+ F90PPR_ENDIF = 279,
+ COMMA = 280,
+ DCOLON = 281,
+ CPP_TOENDL = 282,
+ UNTERMINATED_STRING = 283,
+ STRING = 284,
+ WORD = 285,
+ CPP_INCLUDE_ANGLE = 286
+ };
#endif
/* Tokens. */
#define EOSTMT 258
@@ -244,34 +236,30 @@ static bool cmDependsFortranParserIsKeyword(const char* word,
#define WORD 285
#define CPP_INCLUDE_ANGLE 286
-
-
-
+/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
{
-
-/* Line 293 of yacc.c */
-#line 89 "cmDependsFortranParser.y"
+#line 81 "cmFortranParser.y" /* yacc.c:355 */
char* string;
-
-
-/* Line 293 of yacc.c */
-#line 269 "cmDependsFortranParser.cxx"
-} YYSTYPE;
+#line 249 "cmFortranParser.cxx" /* yacc.c:355 */
+};
# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
-/* Copy the second part of user declarations. */
+int cmFortran_yyparse (yyscan_t yyscanner);
-/* Line 343 of yacc.c */
-#line 281 "cmDependsFortranParser.cxx"
+#endif /* !YY_CMFORTRAN_YY_CMFORTRANPARSERTOKENS_H_INCLUDED */
+
+/* Copy the second part of user declarations. */
+
+#line 263 "cmFortranParser.cxx" /* yacc.c:358 */
#ifdef short
# undef short
@@ -285,11 +273,8 @@ typedef unsigned char yytype_uint8;
#ifdef YYTYPE_INT8
typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
#else
-typedef short int yytype_int8;
+typedef signed char yytype_int8;
#endif
#ifdef YYTYPE_UINT16
@@ -309,8 +294,7 @@ typedef short int yytype_int16;
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# elif ! defined YYSIZE_T
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
@@ -324,38 +308,67 @@ typedef short int yytype_int16;
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
# endif
# endif
# ifndef YY_
-# define YY_(msgid) msgid
+# define YY_(Msgid) Msgid
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__ \
+ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
+ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+# else
+# define YY_ATTRIBUTE(Spec) /* empty */
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+#if !defined _Noreturn \
+ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
+# define YYUSE(E) ((void) (E))
#else
-# define YYUSE(e) /* empty */
+# define YYUSE(E) /* empty */
#endif
-/* Identity function, used to suppress warnings about constant conditions. */
-#ifndef lint
-# define YYID(n) (n)
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized. */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+ _Pragma ("GCC diagnostic pop")
#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int yyi)
-#else
-static int
-YYID (yyi)
- int yyi;
+# define YY_INITIAL_VALUE(Value) Value
#endif
-{
- return yyi;
-}
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
+#endif
+
#if ! defined yyoverflow || YYERROR_VERBOSE
@@ -374,9 +387,9 @@ YYID (yyi)
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
# ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
# endif
@@ -386,8 +399,8 @@ YYID (yyi)
# endif
# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+ /* Pacify GCC's 'empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# ifndef YYSTACK_ALLOC_MAXIMUM
/* The OS might guarantee only one guard page at the bottom of the stack,
and a page size can be as small as 4096 bytes. So we cannot safely
@@ -411,15 +424,13 @@ YYID (yyi)
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined malloc && ! defined EXIT_SUCCESS
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined free && ! defined EXIT_SUCCESS
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
@@ -463,26 +474,26 @@ union yyalloc
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
- while (YYID (0))
+ while (0)
#endif
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
-/* Copy COUNT objects from FROM to TO. The source and destination do
+/* Copy COUNT objects from SRC to DST. The source and destination do
not overlap. */
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+# define YYCOPY(Dst, Src, Count) \
+ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
# else
-# define YYCOPY(To, From, Count) \
+# define YYCOPY(Dst, Src, Count) \
do \
{ \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
+ (Dst)[yyi] = (Src)[yyi]; \
} \
- while (YYID (0))
+ while (0)
# endif
# endif
#endif /* !YYCOPY_NEEDED */
@@ -498,17 +509,19 @@ union yyalloc
#define YYNNTS 16
/* YYNRULES -- Number of rules. */
#define YYNRULES 53
-/* YYNRULES -- Number of states. */
+/* YYNSTATES -- Number of states. */
#define YYNSTATES 97
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+ by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 286
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, without out-of-bounds checking. */
static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -543,52 +556,19 @@ static const yytype_uint8 yytranslate[] =
};
#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const yytype_uint8 yyprhs[] =
-{
- 0, 0, 3, 4, 7, 9, 11, 16, 19, 24,
- 30, 38, 43, 47, 52, 57, 62, 67, 72, 76,
- 80, 84, 88, 93, 97, 99, 101, 103, 105, 107,
- 109, 111, 113, 115, 117, 119, 121, 123, 125, 127,
- 129, 131, 133, 135, 137, 139, 140, 143, 145, 147,
- 149, 151, 153, 155
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yytype_int8 yyrhs[] =
-{
- 33, 0, -1, -1, 33, 34, -1, 36, -1, 35,
- -1, 30, 4, 46, 3, -1, 30, 3, -1, 30,
- 30, 46, 3, -1, 30, 26, 30, 46, 3, -1,
- 30, 25, 30, 26, 30, 46, 3, -1, 30, 29,
- 46, 3, -1, 31, 46, 3, -1, 37, 29, 46,
- 3, -1, 38, 30, 46, 3, -1, 39, 30, 46,
- 3, -1, 40, 30, 46, 3, -1, 41, 30, 46,
- 3, -1, 42, 46, 3, -1, 43, 46, 3, -1,
- 44, 46, 3, -1, 45, 46, 3, -1, 30, 5,
- 46, 3, -1, 5, 46, 3, -1, 3, -1, 1,
- -1, 6, -1, 7, -1, 8, -1, 10, -1, 9,
- -1, 12, -1, 11, -1, 13, -1, 19, -1, 14,
- -1, 20, -1, 15, -1, 21, -1, 17, -1, 23,
- -1, 16, -1, 22, -1, 18, -1, 24, -1, -1,
- 46, 47, -1, 30, -1, 29, -1, 5, -1, 4,
- -1, 26, -1, 25, -1, 28, -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 111, 111, 111, 113, 113, 115, 121, 131, 161,
- 172, 185, 196, 203, 210, 216, 222, 228, 234, 239,
- 244, 249, 254, 258, 259, 260, 265, 265, 265, 266,
- 266, 267, 267, 268, 268, 269, 269, 270, 270, 271,
- 271, 272, 272, 273, 273, 274, 274, 277, 278, 279,
- 280, 281, 282, 283
+ 0, 103, 103, 103, 105, 105, 107, 113, 123, 153,
+ 164, 177, 188, 195, 202, 208, 214, 220, 226, 231,
+ 236, 241, 246, 250, 251, 252, 257, 257, 257, 258,
+ 258, 259, 259, 260, 260, 261, 261, 262, 262, 263,
+ 263, 264, 264, 265, 265, 266, 266, 269, 270, 271,
+ 272, 273, 274, 275
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+#if YYDEBUG || YYERROR_VERBOSE || 1
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
@@ -601,13 +581,13 @@ static const char *const yytname[] =
"F90PPR_ENDIF", "COMMA", "DCOLON", "CPP_TOENDL", "UNTERMINATED_STRING",
"STRING", "WORD", "CPP_INCLUDE_ANGLE", "$accept", "code", "stmt",
"assignment_stmt", "keyword_stmt", "include", "define", "undef", "ifdef",
- "ifndef", "if", "elif", "else", "endif", "other", "misc_code", 0
+ "ifndef", "if", "elif", "else", "endif", "other", "misc_code", YY_NULLPTR
};
#endif
# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+ (internal) symbol number NUM (which must be that of a token). */
static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
@@ -617,31 +597,35 @@ static const yytype_uint16 yytoknum[] =
};
# endif
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint8 yyr1[] =
-{
- 0, 32, 33, 33, 34, 34, 35, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 37, 37, 37, 38,
- 38, 39, 39, 40, 40, 41, 41, 42, 42, 43,
- 43, 44, 44, 45, 45, 46, 46, 47, 47, 47,
- 47, 47, 47, 47
-};
+#define YYPACT_NINF -29
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
+#define yypact_value_is_default(Yystate) \
+ (!!((Yystate) == (-29)))
+
+#define YYTABLE_NINF -1
+
+#define yytable_value_is_error(Yytable_value) \
+ 0
+
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+static const yytype_int16 yypact[] =
{
- 0, 2, 0, 2, 1, 1, 4, 2, 4, 5,
- 7, 4, 3, 4, 4, 4, 4, 4, 3, 3,
- 3, 3, 4, 3, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 0, 2, 1, 1, 1,
- 1, 1, 1, 1
+ -29, 39, -29, -29, -29, -29, -29, -29, -29, -29,
+ -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
+ -29, -29, -29, -29, -29, 246, -29, -29, -29, -29,
+ -28, -27, -22, -17, -16, -29, -29, -29, -29, 2,
+ -29, -29, -29, -13, -12, -29, -29, 61, -29, -29,
+ -29, -29, -29, 68, 74, 80, 108, -29, -29, -29,
+ -29, -29, -29, -29, -29, -29, 114, 120, -24, -29,
+ 126, 154, -29, 160, 166, 172, 200, 206, -29, -29,
+ -29, -29, -29, -29, -9, 212, -29, -29, -29, -29,
+ -29, -29, -29, -29, -29, 218, -29
};
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
- Performed when YYTABLE doesn't specify something else to do. Zero
- means the default is an error. */
+ /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE does not specify something else to do. Zero
+ means the default is an error. */
static const yytype_uint8 yydefact[] =
{
2, 0, 1, 25, 24, 45, 26, 27, 28, 30,
@@ -656,41 +640,23 @@ static const yytype_uint8 yydefact[] =
15, 16, 17, 45, 9, 0, 10
};
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yytype_int8 yydefgoto[] =
-{
- -1, 1, 27, 28, 29, 30, 31, 32, 33, 34,
- 35, 36, 37, 38, 39, 65
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -29
-static const yytype_int16 yypact[] =
+ /* YYPGOTO[NTERM-NUM]. */
+static const yytype_int8 yypgoto[] =
{
- -29, 39, -29, -29, -29, -29, -29, -29, -29, -29,
-29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
- -29, -29, -29, -29, -29, 246, -29, -29, -29, -29,
- -28, -27, -22, -17, -16, -29, -29, -29, -29, 2,
- -29, -29, -29, -13, -12, -29, -29, 61, -29, -29,
- -29, -29, -29, 68, 74, 80, 108, -29, -29, -29,
- -29, -29, -29, -29, -29, -29, 114, 120, -24, -29,
- 126, 154, -29, 160, 166, 172, 200, 206, -29, -29,
- -29, -29, -29, -29, -9, 212, -29, -29, -29, -29,
- -29, -29, -29, -29, -29, 218, -29
+ -29, -29, -29, -29, -26, -29
};
-/* YYPGOTO[NTERM-NUM]. */
-static const yytype_int8 yypgoto[] =
+ /* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int8 yydefgoto[] =
{
- -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
- -29, -29, -29, -29, -26, -29
+ -1, 1, 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 65
};
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -1
+ /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule whose
+ number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_uint8 yytable[] =
{
47, 48, 84, 49, 0, 57, 58, 59, 50, 53,
@@ -723,12 +689,6 @@ static const yytype_uint8 yytable[] =
0, 43, 44, 0, 0, 45, 46
};
-#define yypact_value_is_default(yystate) \
- ((yystate) == (-29))
-
-#define yytable_value_is_error(yytable_value) \
- YYID (0)
-
static const yytype_int8 yycheck[] =
{
26, 29, 26, 30, -1, 3, 4, 5, 30, 35,
@@ -761,8 +721,8 @@ static const yytype_int8 yycheck[] =
-1, 25, 26, -1, -1, 29, 30
};
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
+ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
0, 33, 0, 1, 3, 5, 6, 7, 8, 9,
@@ -777,6 +737,29 @@ static const yytype_uint8 yystos[] =
3, 3, 3, 30, 3, 46, 3
};
+ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const yytype_uint8 yyr1[] =
+{
+ 0, 32, 33, 33, 34, 34, 35, 36, 36, 36,
+ 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+ 36, 36, 36, 36, 36, 36, 37, 37, 37, 38,
+ 38, 39, 39, 40, 40, 41, 41, 42, 42, 43,
+ 43, 44, 44, 45, 45, 46, 46, 47, 47, 47,
+ 47, 47, 47, 47
+};
+
+ /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
+static const yytype_uint8 yyr2[] =
+{
+ 0, 2, 0, 2, 1, 1, 4, 2, 4, 5,
+ 7, 4, 3, 4, 4, 4, 4, 4, 3, 3,
+ 3, 3, 4, 3, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 0, 2, 1, 1, 1,
+ 1, 1, 1, 1
+};
+
+
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY (-2)
@@ -787,84 +770,30 @@ static const yytype_uint8 yystos[] =
#define YYERROR goto yyerrorlab
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. However,
- YYFAIL appears to be in use. Nevertheless, it is formally deprecated
- in Bison 2.4.2's NEWS entry, where a plan to phase it out is
- discussed. */
-
-#define YYFAIL goto yyerrlab
-#if defined YYFAIL
- /* This is here to suppress warnings from the GCC cpp's
- -Wunused-macros. Normally we don't worry about that warning, but
- some users do, and we want to make it easy for users to remove
- YYFAIL uses, which will produce warnings from Bison 2.5. */
-#endif
-
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(Token, Value) \
do \
- if (yychar == YYEMPTY && yylen == 1) \
+ if (yychar == YYEMPTY) \
{ \
yychar = (Token); \
yylval = (Value); \
- YYPOPSTACK (1); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
goto yybackup; \
} \
else \
{ \
- yyerror (YY_("syntax error: cannot back up")); \
+ yyerror (yyscanner, YY_("syntax error: cannot back up")); \
YYERROR; \
} \
-while (YYID (0))
-
+while (0)
+/* Error token number */
#define YYTERROR 1
#define YYERRCODE 256
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
- If N is 0, then set CURRENT to the empty location which ends
- the previous symbol: RHS[0] (always defined). */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (YYID (N)) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
- while (YYID (0))
-#endif
-
-
-/* This macro is provided for backward compatibility. */
-
-#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval)
-#endif
/* Enable debugging if requested. */
#if YYDEBUG
@@ -878,7 +807,13 @@ while (YYID (0))
do { \
if (yydebug) \
YYFPRINTF Args; \
-} while (YYID (0))
+} while (0)
+
+/* This macro is provided for backward compatibility. */
+#ifndef YY_LOCATION_PRINT
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+#endif
+
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
do { \
@@ -886,42 +821,29 @@ do { \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
- Type, Value); \
+ Type, Value, yyscanner); \
YYFPRINTF (stderr, "\n"); \
} \
-} while (YYID (0))
+} while (0)
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+/*----------------------------------------.
+| Print this symbol's value on YYOUTPUT. |
+`----------------------------------------*/
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
-#endif
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, yyscan_t yyscanner)
{
+ FILE *yyo = yyoutput;
+ YYUSE (yyo);
+ YYUSE (yyscanner);
if (!yyvaluep)
return;
# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
- YYUSE (yyoutput);
# endif
- switch (yytype)
- {
- default:
- break;
- }
+ YYUSE (yytype);
}
@@ -929,24 +851,13 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
static void
-yy_symbol_print (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
-#endif
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, yyscan_t yyscanner)
{
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+ YYFPRINTF (yyoutput, "%s %s (",
+ yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
- yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yyscanner);
YYFPRINTF (yyoutput, ")");
}
@@ -955,16 +866,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep)
| TOP (included). |
`------------------------------------------------------------------*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static void
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
-#else
-static void
-yy_stack_print (yybottom, yytop)
- yytype_int16 *yybottom;
- yytype_int16 *yytop;
-#endif
{
YYFPRINTF (stderr, "Stack now");
for (; yybottom <= yytop; yybottom++)
@@ -979,36 +882,29 @@ yy_stack_print (yybottom, yytop)
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
-} while (YYID (0))
+} while (0)
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
-#else
-static void
-yy_reduce_print (yyvsp, yyrule)
- YYSTYPE *yyvsp;
- int yyrule;
-#endif
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, yyscan_t yyscanner)
{
+ unsigned long int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
- unsigned long int yylno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
YYFPRINTF (stderr, " $%d = ", yyi + 1);
- yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+ yy_symbol_print (stderr,
+ yystos[yyssp[yyi + 1 - yynrhs]],
&(yyvsp[(yyi + 1) - (yynrhs)])
- );
+ , yyscanner);
YYFPRINTF (stderr, "\n");
}
}
@@ -1016,8 +912,8 @@ yy_reduce_print (yyvsp, yyrule)
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
- yy_reduce_print (yyvsp, Rule); \
-} while (YYID (0))
+ yy_reduce_print (yyssp, yyvsp, Rule, yyscanner); \
+} while (0)
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
@@ -1054,15 +950,8 @@ int yydebug;
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static YYSIZE_T
yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
- const char *yystr;
-#endif
{
YYSIZE_T yylen;
for (yylen = 0; yystr[yylen]; yylen++)
@@ -1078,16 +967,8 @@ yystrlen (yystr)
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static char *
yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-#endif
{
char *yyd = yydest;
const char *yys = yysrc;
@@ -1160,12 +1041,11 @@ static int
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yytype_int16 *yyssp, int yytoken)
{
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
+ YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
- const char *yyformat = 0;
+ const char *yyformat = YY_NULLPTR;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
@@ -1173,10 +1053,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
int yycount = 0;
/* There are many possibilities here to consider:
- - Assume YYFAIL is not used. It's too flawed to consider. See
- <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
- for details. YYERROR is fine as it does not invoke this
- function.
- If this state is a consistent state with a default action, then
the only way this function was invoked is if the default action
is an error action. In that case, don't check for expected
@@ -1225,11 +1101,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
break;
}
yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
+ {
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+ if (! (yysize <= yysize1
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
}
}
}
@@ -1249,10 +1127,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
# undef YYCASE_
}
- yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
+ {
+ YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
if (*yymsg_alloc < yysize)
{
@@ -1289,81 +1169,39 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
-#else
static void
-yydestruct (yymsg, yytype, yyvaluep)
- const char *yymsg;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, yyscan_t yyscanner)
{
YYUSE (yyvaluep);
-
+ YYUSE (yyscanner);
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
- switch (yytype)
- {
-
- default:
- break;
- }
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ YYUSE (yytype);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-/* Prevent warnings from -Wmissing-prototypes. */
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
/*----------.
| yyparse. |
`----------*/
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void)
-#else
int
-yyparse ()
-
-#endif
-#endif
+yyparse (yyscan_t yyscanner)
{
/* The lookahead symbol. */
int yychar;
+
/* The semantic value of the lookahead symbol. */
-YYSTYPE yylval;
+/* Default value used for initialization, for pacifying older GCCs
+ or non-GCC compilers. */
+YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
+YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
/* Number of syntax errors so far. */
int yynerrs;
@@ -1373,10 +1211,10 @@ YYSTYPE yylval;
int yyerrstatus;
/* The stacks and their tools:
- `yyss': related to states.
- `yyvs': related to semantic values.
+ 'yyss': related to states.
+ 'yyvs': related to semantic values.
- Refer to the stacks thru separate pointers, to allow yyoverflow
+ Refer to the stacks through separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
@@ -1394,7 +1232,7 @@ YYSTYPE yylval;
int yyn;
int yyresult;
/* Lookahead token as an internal (translated) token number. */
- int yytoken;
+ int yytoken = 0;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
@@ -1412,9 +1250,8 @@ YYSTYPE yylval;
Keep to zero when no symbol should be popped. */
int yylen = 0;
- yytoken = 0;
- yyss = yyssa;
- yyvs = yyvsa;
+ yyssp = yyss = yyssa;
+ yyvsp = yyvs = yyvsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n"));
@@ -1423,14 +1260,6 @@ YYSTYPE yylval;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
- yyssp = yyss;
- yyvsp = yyvs;
-
goto yysetstate;
/*------------------------------------------------------------.
@@ -1531,7 +1360,7 @@ yybackup:
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
+ yychar = yylex (&yylval, yyscanner);
}
if (yychar <= YYEOF)
@@ -1571,7 +1400,9 @@ yybackup:
yychar = YYEMPTY;
yystate = yyn;
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
goto yynewstate;
@@ -1594,7 +1425,7 @@ yyreduce:
yylen = yyr2[yyn];
/* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
+ '$$ = $1'.
Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison
@@ -1608,249 +1439,228 @@ yyreduce:
switch (yyn)
{
case 6:
-
-/* Line 1806 of yacc.c */
-#line 116 "cmDependsFortranParser.y"
+#line 108 "cmFortranParser.y" /* yacc.c:1646 */
{
- free((yyvsp[(1) - (4)].string));
+ free((yyvsp[-3].string));
}
+#line 1447 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 7:
-
-/* Line 1806 of yacc.c */
-#line 122 "cmDependsFortranParser.y"
+#line 114 "cmFortranParser.y" /* yacc.c:1646 */
{
- if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (2)].string), "interface"))
+ if (cmFortranParserIsKeyword((yyvsp[-1].string), "interface"))
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_SetInInterface(parser, true);
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_SetInInterface(parser, true);
}
- free((yyvsp[(1) - (2)].string));
+ free((yyvsp[-1].string));
}
+#line 1461 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 8:
-
-/* Line 1806 of yacc.c */
-#line 132 "cmDependsFortranParser.y"
+#line 124 "cmFortranParser.y" /* yacc.c:1646 */
{
- if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (4)].string), "use"))
+ if (cmFortranParserIsKeyword((yyvsp[-3].string), "use"))
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleUse(parser, (yyvsp[(2) - (4)].string));
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
}
- else if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (4)].string), "module"))
+ else if (cmFortranParserIsKeyword((yyvsp[-3].string), "module"))
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleModule(parser, (yyvsp[(2) - (4)].string));
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleModule(parser, (yyvsp[-2].string));
}
- else if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (4)].string), "interface"))
+ else if (cmFortranParserIsKeyword((yyvsp[-3].string), "interface"))
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_SetInInterface(parser, true);
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_SetInInterface(parser, true);
}
- else if (cmDependsFortranParserIsKeyword((yyvsp[(2) - (4)].string), "interface") &&
- cmDependsFortranParserIsKeyword((yyvsp[(1) - (4)].string), "end"))
+ else if (cmFortranParserIsKeyword((yyvsp[-2].string), "interface") &&
+ cmFortranParserIsKeyword((yyvsp[-3].string), "end"))
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_SetInInterface(parser, false);
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_SetInInterface(parser, false);
}
- free((yyvsp[(1) - (4)].string));
- free((yyvsp[(2) - (4)].string));
+ free((yyvsp[-3].string));
+ free((yyvsp[-2].string));
}
+#line 1495 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 9:
-
-/* Line 1806 of yacc.c */
-#line 162 "cmDependsFortranParser.y"
+#line 154 "cmFortranParser.y" /* yacc.c:1646 */
{
- if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (5)].string), "use"))
+ if (cmFortranParserIsKeyword((yyvsp[-4].string), "use"))
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleUse(parser, (yyvsp[(3) - (5)].string));
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
}
- free((yyvsp[(1) - (5)].string));
- free((yyvsp[(3) - (5)].string));
+ free((yyvsp[-4].string));
+ free((yyvsp[-2].string));
}
+#line 1510 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 10:
-
-/* Line 1806 of yacc.c */
-#line 173 "cmDependsFortranParser.y"
+#line 165 "cmFortranParser.y" /* yacc.c:1646 */
{
- if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (7)].string), "use") &&
- cmDependsFortranParserIsKeyword((yyvsp[(3) - (7)].string), "non_intrinsic") )
+ if (cmFortranParserIsKeyword((yyvsp[-6].string), "use") &&
+ cmFortranParserIsKeyword((yyvsp[-4].string), "non_intrinsic") )
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleUse(parser, (yyvsp[(5) - (7)].string));
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
}
- free((yyvsp[(1) - (7)].string));
- free((yyvsp[(3) - (7)].string));
- free((yyvsp[(5) - (7)].string));
+ free((yyvsp[-6].string));
+ free((yyvsp[-4].string));
+ free((yyvsp[-2].string));
}
+#line 1527 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 11:
-
-/* Line 1806 of yacc.c */
-#line 186 "cmDependsFortranParser.y"
+#line 178 "cmFortranParser.y" /* yacc.c:1646 */
{
- if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (4)].string), "include"))
+ if (cmFortranParserIsKeyword((yyvsp[-3].string), "include"))
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleInclude(parser, (yyvsp[(2) - (4)].string));
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
}
- free((yyvsp[(1) - (4)].string));
- free((yyvsp[(2) - (4)].string));
+ free((yyvsp[-3].string));
+ free((yyvsp[-2].string));
}
+#line 1542 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 12:
-
-/* Line 1806 of yacc.c */
-#line 197 "cmDependsFortranParser.y"
+#line 189 "cmFortranParser.y" /* yacc.c:1646 */
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleInclude(parser, (yyvsp[(1) - (3)].string));
- free((yyvsp[(1) - (3)].string));
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
+ free((yyvsp[-2].string));
}
+#line 1553 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 13:
-
-/* Line 1806 of yacc.c */
-#line 204 "cmDependsFortranParser.y"
+#line 196 "cmFortranParser.y" /* yacc.c:1646 */
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleInclude(parser, (yyvsp[(2) - (4)].string));
- free((yyvsp[(2) - (4)].string));
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
+ free((yyvsp[-2].string));
}
+#line 1564 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 14:
-
-/* Line 1806 of yacc.c */
-#line 211 "cmDependsFortranParser.y"
+#line 203 "cmFortranParser.y" /* yacc.c:1646 */
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleDefine(parser, (yyvsp[(2) - (4)].string));
- free((yyvsp[(2) - (4)].string));
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleDefine(parser, (yyvsp[-2].string));
+ free((yyvsp[-2].string));
}
+#line 1574 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 15:
-
-/* Line 1806 of yacc.c */
-#line 217 "cmDependsFortranParser.y"
+#line 209 "cmFortranParser.y" /* yacc.c:1646 */
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleUndef(parser, (yyvsp[(2) - (4)].string));
- free((yyvsp[(2) - (4)].string));
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleUndef(parser, (yyvsp[-2].string));
+ free((yyvsp[-2].string));
}
+#line 1584 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 16:
-
-/* Line 1806 of yacc.c */
-#line 223 "cmDependsFortranParser.y"
+#line 215 "cmFortranParser.y" /* yacc.c:1646 */
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleIfdef(parser, (yyvsp[(2) - (4)].string));
- free((yyvsp[(2) - (4)].string));
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleIfdef(parser, (yyvsp[-2].string));
+ free((yyvsp[-2].string));
}
+#line 1594 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 17:
-
-/* Line 1806 of yacc.c */
-#line 229 "cmDependsFortranParser.y"
+#line 221 "cmFortranParser.y" /* yacc.c:1646 */
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleIfndef(parser, (yyvsp[(2) - (4)].string));
- free((yyvsp[(2) - (4)].string));
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleIfndef(parser, (yyvsp[-2].string));
+ free((yyvsp[-2].string));
}
+#line 1604 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 18:
-
-/* Line 1806 of yacc.c */
-#line 235 "cmDependsFortranParser.y"
+#line 227 "cmFortranParser.y" /* yacc.c:1646 */
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleIf(parser);
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleIf(parser);
}
+#line 1613 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 19:
-
-/* Line 1806 of yacc.c */
-#line 240 "cmDependsFortranParser.y"
+#line 232 "cmFortranParser.y" /* yacc.c:1646 */
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleElif(parser);
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleElif(parser);
}
+#line 1622 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 20:
-
-/* Line 1806 of yacc.c */
-#line 245 "cmDependsFortranParser.y"
+#line 237 "cmFortranParser.y" /* yacc.c:1646 */
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleElse(parser);
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleElse(parser);
}
+#line 1631 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 21:
-
-/* Line 1806 of yacc.c */
-#line 250 "cmDependsFortranParser.y"
+#line 242 "cmFortranParser.y" /* yacc.c:1646 */
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleEndif(parser);
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleEndif(parser);
}
+#line 1640 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 22:
-
-/* Line 1806 of yacc.c */
-#line 255 "cmDependsFortranParser.y"
+#line 247 "cmFortranParser.y" /* yacc.c:1646 */
{
- free((yyvsp[(1) - (4)].string));
+ free((yyvsp[-3].string));
}
+#line 1648 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 47:
-
-/* Line 1806 of yacc.c */
-#line 277 "cmDependsFortranParser.y"
- { free ((yyvsp[(1) - (1)].string)); }
+#line 269 "cmFortranParser.y" /* yacc.c:1646 */
+ { free ((yyvsp[0].string)); }
+#line 1654 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
case 48:
-
-/* Line 1806 of yacc.c */
-#line 278 "cmDependsFortranParser.y"
- { free ((yyvsp[(1) - (1)].string)); }
+#line 270 "cmFortranParser.y" /* yacc.c:1646 */
+ { free ((yyvsp[0].string)); }
+#line 1660 "cmFortranParser.cxx" /* yacc.c:1646 */
break;
-
-/* Line 1806 of yacc.c */
-#line 1860 "cmDependsFortranParser.cxx"
+#line 1664 "cmFortranParser.cxx" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -1872,7 +1682,7 @@ yyreduce:
*++yyvsp = yyval;
- /* Now `shift' the result of the reduction. Determine what state
+ /* Now 'shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
@@ -1887,9 +1697,9 @@ yyreduce:
goto yynewstate;
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
+/*--------------------------------------.
+| yyerrlab -- here on detecting error. |
+`--------------------------------------*/
yyerrlab:
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
@@ -1900,7 +1710,7 @@ yyerrlab:
{
++yynerrs;
#if ! YYERROR_VERBOSE
- yyerror (YY_("syntax error"));
+ yyerror (yyscanner, YY_("syntax error"));
#else
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
yyssp, yytoken)
@@ -1927,7 +1737,7 @@ yyerrlab:
yymsgp = yymsg;
}
}
- yyerror (yymsgp);
+ yyerror (yyscanner, yymsgp);
if (yysyntax_error_status == 2)
goto yyexhaustedlab;
}
@@ -1951,7 +1761,7 @@ yyerrlab:
else
{
yydestruct ("Error: discarding",
- yytoken, &yylval);
+ yytoken, &yylval, yyscanner);
yychar = YYEMPTY;
}
}
@@ -1973,7 +1783,7 @@ yyerrorlab:
if (/*CONSTCOND*/ 0)
goto yyerrorlab;
- /* Do not reclaim the symbols of the rule which action triggered
+ /* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
YYPOPSTACK (yylen);
yylen = 0;
@@ -2009,13 +1819,15 @@ yyerrlab1:
yydestruct ("Error: popping",
- yystos[yystate], yyvsp);
+ yystos[yystate], yyvsp, yyscanner);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
/* Shift the error token. */
@@ -2039,12 +1851,12 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-#if !defined(yyoverflow) || YYERROR_VERBOSE
+#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
yyexhaustedlab:
- yyerror (YY_("memory exhausted"));
+ yyerror (yyscanner, YY_("memory exhausted"));
yyresult = 2;
/* Fall through. */
#endif
@@ -2056,16 +1868,16 @@ yyreturn:
user semantic actions for why this is necessary. */
yytoken = YYTRANSLATE (yychar);
yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval);
+ yytoken, &yylval, yyscanner);
}
- /* Do not reclaim the symbols of the rule which action triggered
+ /* Do not reclaim the symbols of the rule whose action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
YY_STACK_PRINT (yyss, yyssp);
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
+ yystos[*yyssp], yyvsp, yyscanner);
YYPOPSTACK (1);
}
#ifndef yyoverflow
@@ -2076,13 +1888,8 @@ yyreturn:
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
#endif
- /* Make sure YYID is used. */
- return YYID (yyresult);
+ return yyresult;
}
-
-
-
-/* Line 2067 of yacc.c */
-#line 286 "cmDependsFortranParser.y"
+#line 278 "cmFortranParser.y" /* yacc.c:1906 */
/* End of grammar */
diff --git a/Source/cmFortranParser.h b/Source/cmFortranParser.h
new file mode 100644
index 0000000..156c38a
--- /dev/null
+++ b/Source/cmFortranParser.h
@@ -0,0 +1,175 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cmFortranParser_h
+#define cmFortranParser_h
+
+#if !defined(cmFortranLexer_cxx) && !defined(cmFortranParser_cxx)
+# include "cmStandardIncludes.h"
+#endif
+
+#include <stddef.h> /* size_t */
+
+/* Forward declare parser object type. */
+typedef struct cmFortranParser_s cmFortranParser;
+
+/* Functions to enter/exit #include'd files in order. */
+bool cmFortranParser_FilePush(cmFortranParser* parser,
+ const char* fname);
+bool cmFortranParser_FilePop(cmFortranParser* parser);
+
+/* Callbacks for lexer. */
+int cmFortranParser_Input(cmFortranParser* parser,
+ char* buffer, size_t bufferSize);
+
+
+void cmFortranParser_StringStart(cmFortranParser* parser);
+const char* cmFortranParser_StringEnd(cmFortranParser* parser);
+void cmFortranParser_StringAppend(cmFortranParser* parser,
+ char c);
+
+void cmFortranParser_SetInInterface(cmFortranParser* parser,
+ bool is_in);
+bool cmFortranParser_GetInInterface(cmFortranParser* parser);
+
+
+void cmFortranParser_SetInPPFalseBranch(cmFortranParser* parser,
+ bool is_in);
+bool cmFortranParser_GetInPPFalseBranch(cmFortranParser* parser);
+
+
+void cmFortranParser_SetOldStartcond(cmFortranParser* parser,
+ int arg);
+int cmFortranParser_GetOldStartcond(cmFortranParser* parser);
+
+/* Callbacks for parser. */
+void cmFortranParser_Error(cmFortranParser* parser,
+ const char* message);
+void cmFortranParser_RuleUse(cmFortranParser* parser,
+ const char* name);
+void cmFortranParser_RuleInclude(cmFortranParser* parser,
+ const char* name);
+void cmFortranParser_RuleModule(cmFortranParser* parser,
+ const char* name);
+void cmFortranParser_RuleDefine(cmFortranParser* parser,
+ const char* name);
+void cmFortranParser_RuleUndef(cmFortranParser* parser,
+ const char* name);
+void cmFortranParser_RuleIfdef(cmFortranParser* parser,
+ const char* name);
+void cmFortranParser_RuleIfndef(cmFortranParser* parser,
+ const char* name);
+void cmFortranParser_RuleIf(cmFortranParser* parser);
+void cmFortranParser_RuleElif(cmFortranParser* parser);
+void cmFortranParser_RuleElse(cmFortranParser* parser);
+void cmFortranParser_RuleEndif(cmFortranParser* parser);
+
+/* Define the parser stack element type. */
+typedef union cmFortran_yystype_u cmFortran_yystype;
+union cmFortran_yystype_u
+{
+ char* string;
+};
+
+/* Setup the proper yylex interface. */
+#define YY_EXTRA_TYPE cmFortranParser*
+#define YY_DECL \
+int cmFortran_yylex(YYSTYPE* yylvalp, yyscan_t yyscanner)
+#define YYSTYPE cmFortran_yystype
+#define YYSTYPE_IS_DECLARED 1
+#if !defined(cmFortranLexer_cxx)
+# include "cmFortranLexer.h"
+#endif
+#if !defined(cmFortranLexer_cxx)
+#if !defined(cmFortranParser_cxx)
+# undef YY_EXTRA_TYPE
+# undef YY_DECL
+# undef YYSTYPE
+# undef YYSTYPE_IS_DECLARED
+#endif
+#endif
+
+#if !defined(cmFortranLexer_cxx) && !defined(cmFortranParser_cxx)
+#include <stack>
+
+//----------------------------------------------------------------------------
+// Information about a single source file.
+class cmFortranSourceInfo
+{
+public:
+ // The name of the source file.
+ std::string Source;
+
+ // Set of provided and required modules.
+ std::set<std::string> Provides;
+ std::set<std::string> Requires;
+
+ // Set of files included in the translation unit.
+ std::set<std::string> Includes;
+};
+
+//----------------------------------------------------------------------------
+// Parser methods not included in generated interface.
+
+// Get the current buffer processed by the lexer.
+YY_BUFFER_STATE cmFortranLexer_GetCurrentBuffer(yyscan_t yyscanner);
+
+// The parser entry point.
+int cmFortran_yyparse(yyscan_t);
+
+//----------------------------------------------------------------------------
+// Define parser object internal structure.
+struct cmFortranFile
+{
+ cmFortranFile(FILE* file, YY_BUFFER_STATE buffer,
+ const std::string& dir):
+ File(file), Buffer(buffer), Directory(dir) {}
+ FILE* File;
+ YY_BUFFER_STATE Buffer;
+ std::string Directory;
+};
+
+struct cmFortranParser_s
+{
+ cmFortranParser_s(std::vector<std::string> const& includes,
+ std::set<std::string> const& defines,
+ cmFortranSourceInfo& info);
+ ~cmFortranParser_s();
+
+ bool FindIncludeFile(const char* dir, const char* includeName,
+ std::string& fileName);
+
+ // The include file search path.
+ std::vector<std::string> IncludePath;
+
+ // Lexical scanner instance.
+ yyscan_t Scanner;
+
+ // Stack of open files in the translation unit.
+ std::stack<cmFortranFile> FileStack;
+
+ // Buffer for string literals.
+ std::string TokenString;
+
+ // Flag for whether lexer is reading from inside an interface.
+ bool InInterface;
+
+ int OldStartcond;
+ std::set<std::string> PPDefinitions;
+ size_t InPPFalseBranch;
+ std::stack<bool> SkipToEnd;
+
+ // Information about the parsed source.
+ cmFortranSourceInfo& Info;
+};
+#endif
+
+#endif
diff --git a/Source/cmDependsFortranParser.y b/Source/cmFortranParser.y
index a987c13..996bef6 100644
--- a/Source/cmDependsFortranParser.y
+++ b/Source/cmFortranParser.y
@@ -26,42 +26,33 @@ This file must be translated to C and modified to build everywhere.
Run bison like this:
- bison --yacc --name-prefix=cmDependsFortran_yy
- --defines=cmDependsFortranParserTokens.h
- -ocmDependsFortranParser.cxx
- cmDependsFortranParser.y
+ bison --yacc --name-prefix=cmFortran_yy
+ --defines=cmFortranParserTokens.h
+ -ocmFortranParser.cxx
+ cmFortranParser.y
-Modify cmDependsFortranParser.cxx:
- - remove TABs
- - remove use of the 'register' storage class specifier
- - Remove the yyerrorlab block in range ["goto yyerrlab1", "yyerrlab1:"]
+Modify cmFortranParser.cxx:
+ - "#if 0" out yyerrorlab block in range ["goto yyerrlab1", "yyerrlab1:"]
*/
/*-------------------------------------------------------------------------*/
-#define cmDependsFortranParser_cxx
-#include "cmDependsFortranParser.h" /* Interface to parser object. */
-#include "cmDependsFortranParserTokens.h" /* Need YYSTYPE for YY_DECL. */
+#define cmFortranParser_cxx
+#include "cmFortranParser.h" /* Interface to parser object. */
+#include "cmFortranParserTokens.h" /* Need YYSTYPE for YY_DECL. */
#include <cmsys/String.h>
-/* Configure the parser to use a lexer object. */
-#define YYPARSE_PARAM yyscanner
-#define YYLEX_PARAM yyscanner
-#define YYERROR_VERBOSE 1
-#define cmDependsFortran_yyerror(x) \
- cmDependsFortranError(yyscanner, x)
-
/* Forward declare the lexer entry point. */
YY_DECL;
-/* Helper function to forward error callback. */
-static void cmDependsFortranError(yyscan_t yyscanner, const char* message)
+/* Helper function to forward error callback from parser. */
+static void cmFortran_yyerror(yyscan_t yyscanner, const char* message)
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_Error(parser, message);
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_Error(parser, message);
}
-static bool cmDependsFortranParserIsKeyword(const char* word,
+static bool cmFortranParserIsKeyword(const char* word,
const char* keyword)
{
return cmsysString_strcasecmp(word, keyword) == 0;
@@ -79,7 +70,13 @@ static bool cmDependsFortranParserIsKeyword(const char* word,
%}
/* Generate a reentrant parser object. */
-%pure-parser
+%define api.pure
+
+/* Configure the parser to use a lexer object. */
+%lex-param {yyscan_t yyscanner}
+%parse-param {yyscan_t yyscanner}
+
+%define parse.error verbose
%union {
char* string;
@@ -115,63 +112,63 @@ assignment_stmt: WORD ASSIGNMENT_OP other EOSTMT /* Ignore */
keyword_stmt:
WORD EOSTMT
{
- if (cmDependsFortranParserIsKeyword($1, "interface"))
+ if (cmFortranParserIsKeyword($1, "interface"))
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_SetInInterface(parser, true);
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_SetInInterface(parser, true);
}
free($1);
}
| WORD WORD other EOSTMT
{
- if (cmDependsFortranParserIsKeyword($1, "use"))
+ if (cmFortranParserIsKeyword($1, "use"))
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleUse(parser, $2);
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleUse(parser, $2);
}
- else if (cmDependsFortranParserIsKeyword($1, "module"))
+ else if (cmFortranParserIsKeyword($1, "module"))
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleModule(parser, $2);
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleModule(parser, $2);
}
- else if (cmDependsFortranParserIsKeyword($1, "interface"))
+ else if (cmFortranParserIsKeyword($1, "interface"))
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_SetInInterface(parser, true);
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_SetInInterface(parser, true);
}
- else if (cmDependsFortranParserIsKeyword($2, "interface") &&
- cmDependsFortranParserIsKeyword($1, "end"))
+ else if (cmFortranParserIsKeyword($2, "interface") &&
+ cmFortranParserIsKeyword($1, "end"))
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_SetInInterface(parser, false);
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_SetInInterface(parser, false);
}
free($1);
free($2);
}
| WORD DCOLON WORD other EOSTMT
{
- if (cmDependsFortranParserIsKeyword($1, "use"))
+ if (cmFortranParserIsKeyword($1, "use"))
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleUse(parser, $3);
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleUse(parser, $3);
}
free($1);
free($3);
}
| WORD COMMA WORD DCOLON WORD other EOSTMT
{
- if (cmDependsFortranParserIsKeyword($1, "use") &&
- cmDependsFortranParserIsKeyword($3, "non_intrinsic") )
+ if (cmFortranParserIsKeyword($1, "use") &&
+ cmFortranParserIsKeyword($3, "non_intrinsic") )
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleUse(parser, $5);
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleUse(parser, $5);
}
free($1);
free($3);
@@ -179,72 +176,72 @@ keyword_stmt:
}
| WORD STRING other EOSTMT /* Ignore */
{
- if (cmDependsFortranParserIsKeyword($1, "include"))
+ if (cmFortranParserIsKeyword($1, "include"))
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleInclude(parser, $2);
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleInclude(parser, $2);
}
free($1);
free($2);
}
| CPP_INCLUDE_ANGLE other EOSTMT
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleInclude(parser, $1);
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleInclude(parser, $1);
free($1);
}
| include STRING other EOSTMT
{
- cmDependsFortranParser* parser =
- cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleInclude(parser, $2);
+ cmFortranParser* parser =
+ cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleInclude(parser, $2);
free($2);
}
| define WORD other EOSTMT
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleDefine(parser, $2);
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleDefine(parser, $2);
free($2);
}
| undef WORD other EOSTMT
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleUndef(parser, $2);
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleUndef(parser, $2);
free($2);
}
| ifdef WORD other EOSTMT
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleIfdef(parser, $2);
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleIfdef(parser, $2);
free($2);
}
| ifndef WORD other EOSTMT
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleIfndef(parser, $2);
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleIfndef(parser, $2);
free($2);
}
| if other EOSTMT
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleIf(parser);
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleIf(parser);
}
| elif other EOSTMT
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleElif(parser);
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleElif(parser);
}
| else other EOSTMT
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleElse(parser);
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleElse(parser);
}
| endif other EOSTMT
{
- cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
- cmDependsFortranParser_RuleEndif(parser);
+ cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
+ cmFortranParser_RuleEndif(parser);
}
| WORD GARBAGE other EOSTMT /* Ignore */
{
diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx
new file mode 100644
index 0000000..a09c5459
--- /dev/null
+++ b/Source/cmFortranParserImpl.cxx
@@ -0,0 +1,408 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2015 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#include "cmFortranParser.h"
+
+#include "cmSystemTools.h"
+#include <assert.h>
+
+//----------------------------------------------------------------------------
+bool cmFortranParser_s::FindIncludeFile(const char* dir,
+ const char* includeName,
+ std::string& fileName)
+{
+ // If the file is a full path, include it directly.
+ if(cmSystemTools::FileIsFullPath(includeName))
+ {
+ fileName = includeName;
+ return cmSystemTools::FileExists(fileName.c_str(), true);
+ }
+ else
+ {
+ // Check for the file in the directory containing the including
+ // file.
+ std::string fullName = dir;
+ fullName += "/";
+ fullName += includeName;
+ if(cmSystemTools::FileExists(fullName.c_str(), true))
+ {
+ fileName = fullName;
+ return true;
+ }
+
+ // Search the include path for the file.
+ for(std::vector<std::string>::const_iterator i =
+ this->IncludePath.begin(); i != this->IncludePath.end(); ++i)
+ {
+ fullName = *i;
+ fullName += "/";
+ fullName += includeName;
+ if(cmSystemTools::FileExists(fullName.c_str(), true))
+ {
+ fileName = fullName;
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+//----------------------------------------------------------------------------
+cmFortranParser_s
+::cmFortranParser_s(std::vector<std::string> const& includes,
+ std::set<std::string> const& defines,
+ cmFortranSourceInfo& info):
+ IncludePath(includes), PPDefinitions(defines), Info(info)
+{
+ this->InInterface = 0;
+ this->InPPFalseBranch = 0;
+
+ // Initialize the lexical scanner.
+ cmFortran_yylex_init(&this->Scanner);
+ cmFortran_yyset_extra(this, this->Scanner);
+
+ // Create a dummy buffer that is never read but is the fallback
+ // buffer when the last file is popped off the stack.
+ YY_BUFFER_STATE buffer =
+ cmFortran_yy_create_buffer(0, 4, this->Scanner);
+ cmFortran_yy_switch_to_buffer(buffer, this->Scanner);
+}
+
+//----------------------------------------------------------------------------
+cmFortranParser_s::~cmFortranParser_s()
+{
+ cmFortran_yylex_destroy(this->Scanner);
+}
+
+//----------------------------------------------------------------------------
+bool cmFortranParser_FilePush(cmFortranParser* parser,
+ const char* fname)
+{
+ // Open the new file and push it onto the stack. Save the old
+ // buffer with it on the stack.
+ if(FILE* file = cmsys::SystemTools::Fopen(fname, "rb"))
+ {
+ YY_BUFFER_STATE current =
+ cmFortranLexer_GetCurrentBuffer(parser->Scanner);
+ std::string dir = cmSystemTools::GetParentDirectory(fname);
+ cmFortranFile f(file, current, dir);
+ YY_BUFFER_STATE buffer =
+ cmFortran_yy_create_buffer(0, 16384, parser->Scanner);
+ cmFortran_yy_switch_to_buffer(buffer, parser->Scanner);
+ parser->FileStack.push(f);
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+//----------------------------------------------------------------------------
+bool cmFortranParser_FilePop(cmFortranParser* parser)
+{
+ // Pop one file off the stack and close it. Switch the lexer back
+ // to the next one on the stack.
+ if(parser->FileStack.empty())
+ {
+ return 0;
+ }
+ else
+ {
+ cmFortranFile f = parser->FileStack.top(); parser->FileStack.pop();
+ fclose(f.File);
+ YY_BUFFER_STATE current =
+ cmFortranLexer_GetCurrentBuffer(parser->Scanner);
+ cmFortran_yy_delete_buffer(current, parser->Scanner);
+ cmFortran_yy_switch_to_buffer(f.Buffer, parser->Scanner);
+ return 1;
+ }
+}
+
+//----------------------------------------------------------------------------
+int cmFortranParser_Input(cmFortranParser* parser,
+ char* buffer, size_t bufferSize)
+{
+ // Read from the file on top of the stack. If the stack is empty,
+ // the end of the translation unit has been reached.
+ if(!parser->FileStack.empty())
+ {
+ FILE* file = parser->FileStack.top().File;
+ return (int)fread(buffer, 1, bufferSize, file);
+ }
+ return 0;
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_StringStart(cmFortranParser* parser)
+{
+ parser->TokenString = "";
+}
+
+//----------------------------------------------------------------------------
+const char* cmFortranParser_StringEnd(cmFortranParser* parser)
+{
+ return parser->TokenString.c_str();
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_StringAppend(cmFortranParser* parser,
+ char c)
+{
+ parser->TokenString += c;
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_SetInInterface(cmFortranParser* parser,
+ bool in)
+{
+ if(parser->InPPFalseBranch)
+ {
+ return;
+ }
+
+ parser->InInterface = in;
+}
+
+//----------------------------------------------------------------------------
+bool cmFortranParser_GetInInterface(cmFortranParser* parser)
+{
+ return parser->InInterface;
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_SetOldStartcond(cmFortranParser* parser,
+ int arg)
+{
+ parser->OldStartcond = arg;
+}
+
+//----------------------------------------------------------------------------
+int cmFortranParser_GetOldStartcond(cmFortranParser* parser)
+{
+ return parser->OldStartcond;
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_Error(cmFortranParser*, const char*)
+{
+ // If there is a parser error just ignore it. The source will not
+ // compile and the user will edit it. Then dependencies will have
+ // to be regenerated anyway.
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_RuleUse(cmFortranParser* parser,
+ const char* name)
+{
+ if(!parser->InPPFalseBranch)
+ {
+ parser->Info.Requires.insert(cmSystemTools::LowerCase(name) );
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_RuleInclude(cmFortranParser* parser,
+ const char* name)
+{
+ if(parser->InPPFalseBranch)
+ {
+ return;
+ }
+
+ // If processing an include statement there must be an open file.
+ assert(!parser->FileStack.empty());
+
+ // Get the directory containing the source in which the include
+ // statement appears. This is always the first search location for
+ // Fortran include files.
+ std::string dir = parser->FileStack.top().Directory;
+
+ // Find the included file. If it cannot be found just ignore the
+ // problem because either the source will not compile or the user
+ // does not care about depending on this included source.
+ std::string fullName;
+ if(parser->FindIncludeFile(dir.c_str(), name, fullName))
+ {
+ // Found the included file. Save it in the set of included files.
+ parser->Info.Includes.insert(fullName);
+
+ // Parse it immediately to translate the source inline.
+ cmFortranParser_FilePush(parser, fullName.c_str());
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_RuleModule(cmFortranParser* parser,
+ const char* name)
+{
+ if(!parser->InPPFalseBranch && !parser->InInterface)
+ {
+ parser->Info.Provides.insert(cmSystemTools::LowerCase(name));
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_RuleDefine(cmFortranParser* parser,
+ const char* macro)
+{
+ if(!parser->InPPFalseBranch)
+ {
+ parser->PPDefinitions.insert(macro);
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_RuleUndef(cmFortranParser* parser,
+ const char* macro)
+{
+ if(!parser->InPPFalseBranch)
+ {
+ std::set<std::string>::iterator match;
+ match = parser->PPDefinitions.find(macro);
+ if(match != parser->PPDefinitions.end())
+ {
+ parser->PPDefinitions.erase(match);
+ }
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_RuleIfdef(cmFortranParser* parser,
+ const char* macro)
+{
+ // A new PP branch has been opened
+ parser->SkipToEnd.push(false);
+
+ if (parser->InPPFalseBranch)
+ {
+ parser->InPPFalseBranch++;
+ }
+ else if(parser->PPDefinitions.find(macro) == parser->PPDefinitions.end())
+ {
+ parser->InPPFalseBranch=1;
+ }
+ else
+ {
+ parser->SkipToEnd.top() = true;
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_RuleIfndef(cmFortranParser* parser,
+ const char* macro)
+{
+ // A new PP branch has been opened
+ parser->SkipToEnd.push(false);
+
+ if (parser->InPPFalseBranch)
+ {
+ parser->InPPFalseBranch++;
+ }
+ else if(parser->PPDefinitions.find(macro) != parser->PPDefinitions.end())
+ {
+ parser->InPPFalseBranch = 1;
+ }
+ else
+ {
+ // ignore other branches
+ parser->SkipToEnd.top() = true;
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_RuleIf(cmFortranParser* parser)
+{
+ /* Note: The current parser is _not_ able to get statements like
+ * #if 0
+ * #if 1
+ * #if MYSMBOL
+ * #if defined(MYSYMBOL)
+ * #if defined(MYSYMBOL) && ...
+ * right. The same for #elif. Thus in
+ * #if SYMBOL_1
+ * ..
+ * #elif SYMBOL_2
+ * ...
+ * ...
+ * #elif SYMBOL_N
+ * ..
+ * #else
+ * ..
+ * #endif
+ * _all_ N+1 branches are considered. If you got something like this
+ * #if defined(MYSYMBOL)
+ * #if !defined(MYSYMBOL)
+ * use
+ * #ifdef MYSYMBOL
+ * #ifndef MYSYMBOL
+ * instead.
+ */
+
+ // A new PP branch has been opened
+ // Never skip! See note above.
+ parser->SkipToEnd.push(false);
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_RuleElif(cmFortranParser* parser)
+{
+ /* Note: There are parser limitations. See the note at
+ * cmFortranParser_RuleIf(..)
+ */
+
+ // Always taken unless an #ifdef or #ifndef-branch has been taken
+ // already. If the second condition isn't meet already
+ // (parser->InPPFalseBranch == 0) correct it.
+ if(!parser->SkipToEnd.empty() &&
+ parser->SkipToEnd.top() && !parser->InPPFalseBranch)
+ {
+ parser->InPPFalseBranch = 1;
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_RuleElse(cmFortranParser* parser)
+{
+ // if the parent branch is false do nothing!
+ if(parser->InPPFalseBranch > 1)
+ {
+ return;
+ }
+
+ // parser->InPPFalseBranch is either 0 or 1. We change it depending on
+ // parser->SkipToEnd.top()
+ if(!parser->SkipToEnd.empty() &&
+ parser->SkipToEnd.top())
+ {
+ parser->InPPFalseBranch = 1;
+ }
+ else
+ {
+ parser->InPPFalseBranch = 0;
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmFortranParser_RuleEndif(cmFortranParser* parser)
+{
+ if(!parser->SkipToEnd.empty())
+ {
+ parser->SkipToEnd.pop();
+ }
+
+ // #endif doesn't know if there was a "#else" in before, so it
+ // always decreases InPPFalseBranch
+ if(parser->InPPFalseBranch)
+ {
+ parser->InPPFalseBranch--;
+ }
+}
diff --git a/Source/cmDependsFortranParserTokens.h b/Source/cmFortranParserTokens.h
index 941eda0..df1aec3 100644
--- a/Source/cmDependsFortranParserTokens.h
+++ b/Source/cmFortranParserTokens.h
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 2.5. */
+/* A Bison parser, made by GNU Bison 3.0.2. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,43 +30,51 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
+#ifndef YY_CMFORTRAN_YY_CMFORTRANPARSERTOKENS_H_INCLUDED
+# define YY_CMFORTRAN_YY_CMFORTRANPARSERTOKENS_H_INCLUDED
+/* Debug traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int cmFortran_yydebug;
+#endif
-/* Tokens. */
+/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- EOSTMT = 258,
- ASSIGNMENT_OP = 259,
- GARBAGE = 260,
- CPP_INCLUDE = 261,
- F90PPR_INCLUDE = 262,
- COCO_INCLUDE = 263,
- F90PPR_DEFINE = 264,
- CPP_DEFINE = 265,
- F90PPR_UNDEF = 266,
- CPP_UNDEF = 267,
- CPP_IFDEF = 268,
- CPP_IFNDEF = 269,
- CPP_IF = 270,
- CPP_ELSE = 271,
- CPP_ELIF = 272,
- CPP_ENDIF = 273,
- F90PPR_IFDEF = 274,
- F90PPR_IFNDEF = 275,
- F90PPR_IF = 276,
- F90PPR_ELSE = 277,
- F90PPR_ELIF = 278,
- F90PPR_ENDIF = 279,
- COMMA = 280,
- DCOLON = 281,
- CPP_TOENDL = 282,
- UNTERMINATED_STRING = 283,
- STRING = 284,
- WORD = 285,
- CPP_INCLUDE_ANGLE = 286
- };
+ enum yytokentype
+ {
+ EOSTMT = 258,
+ ASSIGNMENT_OP = 259,
+ GARBAGE = 260,
+ CPP_INCLUDE = 261,
+ F90PPR_INCLUDE = 262,
+ COCO_INCLUDE = 263,
+ F90PPR_DEFINE = 264,
+ CPP_DEFINE = 265,
+ F90PPR_UNDEF = 266,
+ CPP_UNDEF = 267,
+ CPP_IFDEF = 268,
+ CPP_IFNDEF = 269,
+ CPP_IF = 270,
+ CPP_ELSE = 271,
+ CPP_ELIF = 272,
+ CPP_ENDIF = 273,
+ F90PPR_IFDEF = 274,
+ F90PPR_IFNDEF = 275,
+ F90PPR_IF = 276,
+ F90PPR_ELSE = 277,
+ F90PPR_ELIF = 278,
+ F90PPR_ENDIF = 279,
+ COMMA = 280,
+ DCOLON = 281,
+ CPP_TOENDL = 282,
+ UNTERMINATED_STRING = 283,
+ STRING = 284,
+ WORD = 285,
+ CPP_INCLUDE_ANGLE = 286
+ };
#endif
/* Tokens. */
#define EOSTMT 258
@@ -99,24 +107,23 @@
#define WORD 285
#define CPP_INCLUDE_ANGLE 286
-
-
-
+/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
{
-
-/* Line 2068 of yacc.c */
-#line 89 "cmDependsFortranParser.y"
+#line 81 "cmFortranParser.y" /* yacc.c:1909 */
char* string;
-
-
-/* Line 2068 of yacc.c */
-#line 118 "cmDependsFortranParserTokens.h"
-} YYSTYPE;
+#line 120 "cmFortranParserTokens.h" /* yacc.c:1909 */
+};
# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
+
+
+
+int cmFortran_yyparse (yyscan_t yyscanner);
+
+#endif /* !YY_CMFORTRAN_YY_CMFORTRANPARSERTOKENS_H_INCLUDED */