mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Update calcEntry grammar to include copyright.
Include character class (wchar_t or char) as a template parameter in CocoParserErrors.
This commit is contained in:
@ -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]
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -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<class BaseClass>
|
||||
template<class BaseClass, class CharClass=wchar_t>
|
||||
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);
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user