diff --git a/applications/test/dictionary/calcEntry/calcEntryParser.atg b/applications/test/dictionary/calcEntry/calcEntryParser.atg index e1a1567700..7dfb17c107 100644 --- a/applications/test/dictionary/calcEntry/calcEntryParser.atg +++ b/applications/test/dictionary/calcEntry/calcEntryParser.atg @@ -1,8 +1,9 @@ +[copy] /*---------------------------------*- C++ -*---------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,15 +28,19 @@ License Description An attributed Coco/R grammar to parse simple arithmetic expressions + Includes support for dictionary $variables and some scalar functions + (eg, sin, pow, ...) + SourceFiles generated \*---------------------------------------------------------------------------*/ +[/copy] /*---------------------------------------------------------------------------*\ compile with: Coco \ [-single] -frames $WM_THIRD_PARTY_DIR/coco-r \ - calcEntryParser.ATG + calcEntryParser.atg \*---------------------------------------------------------------------------*/ #include "dictionary.H" @@ -49,8 +54,6 @@ COMPILER calcEntry $namespace=Foam::functionEntries::calcEntryInternal $eof=true // grammar handles eof itself - // Simple four function calculator for OpenFOAM dictionaries - private: //- The parent dictionary dictionary* dict_; @@ -125,9 +128,10 @@ public: } -INITIALIZE +[initialize] dict_ = 0; val = 0; +[/initialize] /*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/db/error/CocoParserErrors.H b/src/OpenFOAM/db/error/CocoParserErrors.H index 21f574592d..d9d2155db2 100644 --- a/src/OpenFOAM/db/error/CocoParserErrors.H +++ b/src/OpenFOAM/db/error/CocoParserErrors.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,7 +45,7 @@ namespace Foam Class CocoParserErrors Declaration \*---------------------------------------------------------------------------*/ -template +template class CocoParserErrors : public BaseClass @@ -90,14 +90,14 @@ public: // Error Handling //- Handle a general warning 'msg' - virtual void Warning(const wchar_t* msg) + virtual void Warning(const CharClass* msg) { WarningIn(name_) << msg << endl; } //- Handle a general warning 'msg' - virtual void Warning(int line, int col, const wchar_t* msg) + virtual void Warning(int line, int col, const CharClass* msg) { WarningIn(name_) <<"line " << line << " col " << col << ": " @@ -105,7 +105,7 @@ public: } //- Handle general error 'msg' (eg, a semantic error) - virtual void Error(int line, int col, const wchar_t* msg) + virtual void Error(int line, int col, const CharClass* msg) { FatalErrorIn(name_) << "line " << line << " col " << col <<": " << msg << endl @@ -113,7 +113,7 @@ public: } //- Handle general error 'msg' (eg, a semantic error) - virtual void Error(const wchar_t* msg) + virtual void Error(const CharClass* msg) { FatalErrorIn(name_) << msg << endl @@ -121,7 +121,7 @@ public: } //- Handle a general exception 'msg' - virtual void Exception(const wchar_t* msg) + virtual void Exception(const CharClass* msg) { this->Error(msg); } diff --git a/wmake/rules/General/coco b/wmake/rules/General/coco index 97b345c512..46fae00453 100644 --- a/wmake/rules/General/coco +++ b/wmake/rules/General/coco @@ -2,7 +2,12 @@ .SUFFIXES: .atg -atgtoo = Coco -single -frames $(WM_THIRD_PARTY_DIR)/coco-cpp/src $$SOURCE -o $(OBJECTS_DIR) ; $(CC) $(c++FLAGS) -c $*.cpp -o $@ +atgtoo = \ + $(WM_THIRD_PARTY_DIR)/coco-cpp/platforms/$(WM_ARCH)/bin/coco-cpp \ + -single \ + -frames $(WM_THIRD_PARTY_DIR)/coco-cpp/platforms/share/coco-cpp \ + $$SOURCE -o $(OBJECTS_DIR) ; \ + $(CC) $(c++FLAGS) -c $*.cpp -o $@ .atg.dep: $(MAKE_DEP)