Overview
Comment:Now recognises keywords terminated with ; as well as ws.
Now recognises # as a comment when not terminated by ws.
i.e. CarnotCycle_input.txt now gets translated correctly!
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: bb5d4af11f3b92b7999aa43b4c77988297247abbf73af3b54fe79d80c4c843f9
User & Date: geraint@users.sourceforge.net on 2002-05-01 12:54:55
Other Links: branch diff | manifest | tags
Context
2002-05-01
13:43:21
New example using the -dr option check-in: 6775ae90aa user: gawthrop@users.sourceforge.net tags: origin/master, trunk
12:54:55
Now recognises keywords terminated with ; as well as ws.
Now recognises # as a comment when not terminated by ws.
i.e. CarnotCycle_input.txt now gets translated correctly!
check-in: bb5d4af11f user: geraint@users.sourceforge.net tags: origin/master, trunk
12:24:41
Removed unnecessary inclusion of load-save.h. check-in: 7b436c411b user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/cc/parse_m2cc.cc from [7241edf764] to [dc545609f6].

1
2



3
4
5
6
7
8
9
/* $Id$
 * $Log$



 * Revision 1.2.2.1  2001/06/30 03:26:17  geraint
 * gcc-3.0 compatibility.
 *
 * Revision 1.2  2001/03/19 02:28:53  geraint
 * Branch merge: merging-ode2odes-exe back to MAIN.
 *
 * Revision 1.1.2.2  2001/03/09 04:01:20  geraint


>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
/* $Id$
 * $Log$
 * Revision 1.3  2001/07/13 04:54:04  geraint
 * Branch merge: numerical-algebraic-solution back to main.
 *
 * Revision 1.2.2.1  2001/06/30 03:26:17  geraint
 * gcc-3.0 compatibility.
 *
 * Revision 1.2  2001/03/19 02:28:53  geraint
 * Branch merge: merging-ode2odes-exe back to MAIN.
 *
 * Revision 1.1.2.2  2001/03/09 04:01:20  geraint
300
301
302
303
304
305
306

307
308
309
310
311
312
313
		{
		  buf += c;
		}
	      cout << buf;
	    }
	  buf = "";
	  break;

	case '\n':
	  if (keyword [buf])
	    {
	      /*
	       * keyword found, call function
	       */
	      keyword [buf] ();







>







303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
		{
		  buf += c;
		}
	      cout << buf;
	    }
	  buf = "";
	  break;
	case ';':
	case '\n':
	  if (keyword [buf])
	    {
	      /*
	       * keyword found, call function
	       */
	      keyword [buf] ();
323
324
325
326
327
328
329

























330
331
332
333
334
335
336
		 * EOL is end-of-statement in Octave, add ;
		 */
		   << indent () << ';' << endl
		   << indent ();
	    }
	  buf = "";
	  break;

























	case '\\':
	  cin >> c;
	  if ('\n' == c)
	    {
	      buf += '\n';
	    }
	  else







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
		 * EOL is end-of-statement in Octave, add ;
		 */
		   << indent () << ';' << endl
		   << indent ();
	    }
	  buf = "";
	  break;
	case '#':
	  if (keyword [buf])
	    {
	      /*
	       * keyword found, call function
	       */
	      keyword [buf] ();
	    }
	  else
	    {
	      cout << buf
		/*
		 * keep newline in case this line has an EOL-comment
		 */
		   << endl
		/*
		 * EOL is end-of-statement in Octave, add ;
		 */
		   << indent () << ';' << endl
		   << indent ();
	    }
	  keyword ["#"] ();
	  buf = "";
	  break;

	case '\\':
	  cin >> c;
	  if ('\n' == c)
	    {
	      buf += '\n';
	    }
	  else


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]