Skip to content
Snippets Groups Projects
Commit 9129dbd4 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

Merge remote-tracking branch 'origin/master' into develop

parents 2dff1548 aafbb672
Branches
Tags
No related merge requests found
...@@ -96,7 +96,7 @@ else ...@@ -96,7 +96,7 @@ else
fileName="$className$Type" fileName="$className$Type"
echo "$Script: Creating new interface file $fileName" echo "$Script: Creating new code file $fileName"
if [ -e "$fileName" ] if [ -e "$fileName" ]
then then
echo " Error: file exists" echo " Error: file exists"
......
...@@ -32,9 +32,11 @@ rm -f Make/options ...@@ -32,9 +32,11 @@ rm -f Make/options
echo "Creating Make/options" echo "Creating Make/options"
echo 'EXE_INC = \ echo 'EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude' > Make/options -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude' > Make/options
echo >> Make/options echo >> Make/options
echo 'EXE_LIBS = \ echo 'EXE_LIBS = \
-lfiniteVolume' >> Make/options -lfiniteVolume \
-lmeshTools' >> Make/options
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
...@@ -73,7 +73,7 @@ Note ...@@ -73,7 +73,7 @@ Note
#include <unordered_set> #include <unordered_set>
#include <vector> #include <vector>
// Ragel switchs may have several implicit fallthroughs // Ragel switches may have several implicit fallthroughs
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
// Length of the input read buffer // Length of the input read buffer
...@@ -312,7 +312,7 @@ namespace Files ...@@ -312,7 +312,7 @@ namespace Files
// Can use 'variable p xxx;' etc to change these names // Can use 'variable p xxx;' etc to change these names
#line 337 "wmkdepend.rl" #line 341 "wmkdepend.rl"
...@@ -328,15 +328,31 @@ static const int wmkdep_error = 0; ...@@ -328,15 +328,31 @@ static const int wmkdep_error = 0;
static const int wmkdep_en_main = 21; static const int wmkdep_en_main = 21;
#line 345 "wmkdepend.rl" #line 349 "wmkdepend.rl"
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void processFile(std::string fileName);
//
// Open a file and process.
// The file name is given by the [first,last) range
//
void processFile(const char* first, const char* last)
{
// Extra safety
if (first && last && last > first)
{
processFile(std::string(first, last));
}
}
// //
// Open a file and process // Open a file and process
// //
void processFile(const std::string& fileName) void processFile(std::string fileName)
{ {
FILE* infile = Files::open(fileName); FILE* infile = Files::open(fileName);
if (optVerbose) if (optVerbose)
...@@ -351,7 +367,7 @@ void processFile(const std::string& fileName) ...@@ -351,7 +367,7 @@ void processFile(const std::string& fileName)
int act, cs; int act, cs;
#line 355 "wmkdepend.cpp" #line 371 "wmkdepend.cpp"
{ {
cs = wmkdep_start; cs = wmkdep_start;
ts = 0; ts = 0;
...@@ -359,7 +375,7 @@ void processFile(const std::string& fileName) ...@@ -359,7 +375,7 @@ void processFile(const std::string& fileName)
act = 0; act = 0;
} }
#line 366 "wmkdepend.rl" #line 386 "wmkdepend.rl"
/* ^^^ FSM initialization here ^^^ */; /* ^^^ FSM initialization here ^^^ */;
// Local token start // Local token start
...@@ -404,7 +420,7 @@ void processFile(const std::string& fileName) ...@@ -404,7 +420,7 @@ void processFile(const std::string& fileName)
} }
#line 408 "wmkdepend.cpp" #line 424 "wmkdepend.cpp"
{ {
if ( p == pe ) if ( p == pe )
goto _test_eof; goto _test_eof;
...@@ -423,35 +439,35 @@ tr0: ...@@ -423,35 +439,35 @@ tr0:
} }
goto st21; goto st21;
tr2: tr2:
#line 335 "wmkdepend.rl" #line 339 "wmkdepend.rl"
{te = p+1;} {te = p+1;}
goto st21; goto st21;
tr17: tr17:
#line 335 "wmkdepend.rl" #line 339 "wmkdepend.rl"
{{p = ((te))-1;}} {{p = ((te))-1;}}
goto st21; goto st21;
tr21: tr21:
#line 330 "wmkdepend.rl" #line 334 "wmkdepend.rl"
{te = p+1;} {te = p+1;}
goto st21; goto st21;
tr29: tr29:
#line 333 "wmkdepend.rl" #line 337 "wmkdepend.rl"
{te = p+1;} {te = p+1;}
goto st21; goto st21;
tr31: tr31:
#line 332 "wmkdepend.rl" #line 336 "wmkdepend.rl"
{te = p+1;} {te = p+1;}
goto st21; goto st21;
tr36: tr36:
#line 327 "wmkdepend.rl" #line 331 "wmkdepend.rl"
{te = p;p--;} {te = p;p--;}
goto st21; goto st21;
tr37: tr37:
#line 335 "wmkdepend.rl" #line 339 "wmkdepend.rl"
{te = p;p--;} {te = p;p--;}
goto st21; goto st21;
tr38: tr38:
#line 333 "wmkdepend.rl" #line 337 "wmkdepend.rl"
{te = p;p--;} {te = p;p--;}
goto st21; goto st21;
st21: st21:
...@@ -464,7 +480,7 @@ st21: ...@@ -464,7 +480,7 @@ st21:
case 21: case 21:
#line 1 "NONE" #line 1 "NONE"
{ts = p;} {ts = p;}
#line 468 "wmkdepend.cpp" #line 484 "wmkdepend.cpp"
switch( (*p) ) { switch( (*p) ) {
case 10: goto st23; case 10: goto st23;
case 11: goto tr34; case 11: goto tr34;
...@@ -485,14 +501,14 @@ case 1: ...@@ -485,14 +501,14 @@ case 1:
tr32: tr32:
#line 1 "NONE" #line 1 "NONE"
{te = p+1;} {te = p+1;}
#line 327 "wmkdepend.rl" #line 331 "wmkdepend.rl"
{act = 1;} {act = 1;}
goto st22; goto st22;
st22: st22:
if ( ++p == pe ) if ( ++p == pe )
goto _test_eof22; goto _test_eof22;
case 22: case 22:
#line 496 "wmkdepend.cpp" #line 512 "wmkdepend.cpp"
switch( (*p) ) { switch( (*p) ) {
case 10: goto st23; case 10: goto st23;
case 11: goto tr34; case 11: goto tr34;
...@@ -514,14 +530,14 @@ case 23: ...@@ -514,14 +530,14 @@ case 23:
tr34: tr34:
#line 1 "NONE" #line 1 "NONE"
{te = p+1;} {te = p+1;}
#line 327 "wmkdepend.rl" #line 331 "wmkdepend.rl"
{act = 1;} {act = 1;}
goto st24; goto st24;
st24: st24:
if ( ++p == pe ) if ( ++p == pe )
goto _test_eof24; goto _test_eof24;
case 24: case 24:
#line 525 "wmkdepend.cpp" #line 541 "wmkdepend.cpp"
switch( (*p) ) { switch( (*p) ) {
case 10: goto st23; case 10: goto st23;
case 32: goto tr34; case 32: goto tr34;
...@@ -620,13 +636,13 @@ case 10: ...@@ -620,13 +636,13 @@ case 10:
goto tr12; goto tr12;
tr12: tr12:
#line 315 "wmkdepend.rl" #line 315 "wmkdepend.rl"
{ tok = p; /* Local token start */ } { tok = p; /* Local token start */ }
goto st11; goto st11;
st11: st11:
if ( ++p == pe ) if ( ++p == pe )
goto _test_eof11; goto _test_eof11;
case 11: case 11:
#line 630 "wmkdepend.cpp" #line 646 "wmkdepend.cpp"
switch( (*p) ) { switch( (*p) ) {
case 10: goto tr15; case 10: goto tr15;
case 34: goto tr16; case 34: goto tr16;
...@@ -636,7 +652,7 @@ tr13: ...@@ -636,7 +652,7 @@ tr13:
#line 1 "NONE" #line 1 "NONE"
{te = p+1;} {te = p+1;}
#line 315 "wmkdepend.rl" #line 315 "wmkdepend.rl"
{ tok = p; /* Local token start */ } { tok = p; /* Local token start */ }
goto st25; goto st25;
tr15: tr15:
#line 1 "NONE" #line 1 "NONE"
...@@ -646,7 +662,7 @@ st25: ...@@ -646,7 +662,7 @@ st25:
if ( ++p == pe ) if ( ++p == pe )
goto _test_eof25; goto _test_eof25;
case 25: case 25:
#line 650 "wmkdepend.cpp" #line 666 "wmkdepend.cpp"
if ( (*p) == 34 ) if ( (*p) == 34 )
goto tr19; goto tr19;
goto st12; goto st12;
...@@ -658,26 +674,32 @@ case 12: ...@@ -658,26 +674,32 @@ case 12:
goto tr19; goto tr19;
goto st12; goto st12;
tr19: tr19:
#line 316 "wmkdepend.rl" #line 317 "wmkdepend.rl"
{ processFile(std::string(tok, (p - tok))); } {
processFile(tok, p);
tok = nullptr; /* Done with buffer */
}
goto st13; goto st13;
st13: st13:
if ( ++p == pe ) if ( ++p == pe )
goto _test_eof13; goto _test_eof13;
case 13: case 13:
#line 669 "wmkdepend.cpp" #line 688 "wmkdepend.cpp"
if ( (*p) == 10 ) if ( (*p) == 10 )
goto tr21; goto tr21;
goto st13; goto st13;
tr16: tr16:
#line 316 "wmkdepend.rl" #line 317 "wmkdepend.rl"
{ processFile(std::string(tok, (p - tok))); } {
processFile(tok, p);
tok = nullptr; /* Done with buffer */
}
goto st14; goto st14;
st14: st14:
if ( ++p == pe ) if ( ++p == pe )
goto _test_eof14; goto _test_eof14;
case 14: case 14:
#line 681 "wmkdepend.cpp" #line 703 "wmkdepend.cpp"
if ( (*p) == 10 ) if ( (*p) == 10 )
goto tr21; goto tr21;
goto st14; goto st14;
...@@ -708,7 +730,7 @@ st26: ...@@ -708,7 +730,7 @@ st26:
if ( ++p == pe ) if ( ++p == pe )
goto _test_eof26; goto _test_eof26;
case 26: case 26:
#line 712 "wmkdepend.cpp" #line 734 "wmkdepend.cpp"
if ( (*p) == 42 ) if ( (*p) == 42 )
goto st18; goto st18;
goto st17; goto st17;
...@@ -741,14 +763,14 @@ case 19: ...@@ -741,14 +763,14 @@ case 19:
tr30: tr30:
#line 1 "NONE" #line 1 "NONE"
{te = p+1;} {te = p+1;}
#line 333 "wmkdepend.rl" #line 337 "wmkdepend.rl"
{act = 4;} {act = 4;}
goto st27; goto st27;
st27: st27:
if ( ++p == pe ) if ( ++p == pe )
goto _test_eof27; goto _test_eof27;
case 27: case 27:
#line 752 "wmkdepend.cpp" #line 774 "wmkdepend.cpp"
if ( (*p) == 10 ) if ( (*p) == 10 )
goto tr2; goto tr2;
goto st1; goto st1;
...@@ -823,7 +845,7 @@ cs = 0; ...@@ -823,7 +845,7 @@ cs = 0;
_out: {} _out: {}
} }
#line 409 "wmkdepend.rl" #line 429 "wmkdepend.rl"
/* ^^^ FSM execution here ^^^ */; /* ^^^ FSM execution here ^^^ */;
if (0 == cs) if (0 == cs)
...@@ -837,11 +859,23 @@ cs = 0; ...@@ -837,11 +859,23 @@ cs = 0;
if (ts) if (ts)
{ {
// Preserve incomplete token // Preserve incomplete token.
// We have the normal ragel range (ts, te) but potentially
// our own local buffer start as 'tok'
if (tok && tok >= ts)
{
tok = inbuf + (tok - ts);
}
else
{
tok = nullptr; // safety
}
pending = pe - ts; pending = pe - ts;
memmove(inbuf, ts, pending); memmove(inbuf, ts, pending);
te = inbuf + (te - ts); // token end (after memmove) te = inbuf + (te - ts); // token end (after memmove)
ts = inbuf; // token start ts = inbuf; // token start
} }
else else
{ {
......
...@@ -71,7 +71,7 @@ Note ...@@ -71,7 +71,7 @@ Note
#include <unordered_set> #include <unordered_set>
#include <vector> #include <vector>
// Ragel switchs may have several implicit fallthroughs // Ragel switches may have several implicit fallthroughs
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
// Length of the input read buffer // Length of the input read buffer
...@@ -312,8 +312,12 @@ namespace Files ...@@ -312,8 +312,12 @@ namespace Files
%%{ %%{
machine wmkdep; machine wmkdep;
action buffer { tok = p; /* Local token start */ } action buffer { tok = p; /* Local token start */ }
action process { processFile(std::string(tok, (p - tok))); } action process
{
processFile(tok, p);
tok = nullptr; /* Done with buffer */
}
white = [ \t\f\r]; # Horizontal whitespace white = [ \t\f\r]; # Horizontal whitespace
nl = white* '\n'; # Newline (allow trailing whitespace) nl = white* '\n'; # Newline (allow trailing whitespace)
...@@ -346,10 +350,26 @@ namespace Files ...@@ -346,10 +350,26 @@ namespace Files
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void processFile(std::string fileName);
//
// Open a file and process.
// The file name is given by the [first,last) range
//
void processFile(const char* first, const char* last)
{
// Extra safety
if (first && last && last > first)
{
processFile(std::string(first, last));
}
}
// //
// Open a file and process // Open a file and process
// //
void processFile(const std::string& fileName) void processFile(std::string fileName)
{ {
FILE* infile = Files::open(fileName); FILE* infile = Files::open(fileName);
if (optVerbose) if (optVerbose)
...@@ -419,11 +439,23 @@ void processFile(const std::string& fileName) ...@@ -419,11 +439,23 @@ void processFile(const std::string& fileName)
if (ts) if (ts)
{ {
// Preserve incomplete token // Preserve incomplete token.
// We have the normal ragel range (ts, te) but potentially
// our own local buffer start as 'tok'
if (tok && tok >= ts)
{
tok = inbuf + (tok - ts);
}
else
{
tok = nullptr; // safety
}
pending = pe - ts; pending = pe - ts;
memmove(inbuf, ts, pending); memmove(inbuf, ts, pending);
te = inbuf + (te - ts); // token end (after memmove) te = inbuf + (te - ts); // token end (after memmove)
ts = inbuf; // token start ts = inbuf; // token start
} }
else else
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment