<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I want to implement a simple language translator (a superset of C++),
but I haven't done anything of this kind since college (a couple
decades ago).&nbsp; I would like to use python tools as much as possible.<br>
<br>
<tt>NICL code</tt> -&gt; [C++ preprocessor (gcc)] -&gt; <font
 color="#993399">[NICL translator]</font> -&gt; [C++ compiler (gcc)]
-&gt; <tt>object code</tt><br>
<br>
The translator needs to be able to parse special non-c++ syntax to
generate c++, and leave other code intact.<br>
<br>
More documentation on my project here:<br>
&nbsp; <a
 href="http://www.seehart.com/neuralintegrator.com/documentation/ni_book/defining_cell_types.st">http://www.seehart.com/neuralintegrator.com/documentation/ni_book/defining_cell_types.st</a><br>
<br>
I could almost get by with just a python script using regular
expressions (my grammar is simple enough), but I need to know a certain
amount of contextual information. E.g., if I am parsing "cellclass
mycell { ... }", the contents between the braces must be processed
accordingly.&nbsp; This means I have to know when I reach the closing brace
(which I can't do with regular expressions).&nbsp; However, I'm sure I could
do a prototype this way, using the assumption that the a closing brace
on a class matches "^};", but that would be just plain sloppy :-)<br>
<br>
So I think one way or another I'm stuck with implementing an LALR
parser.<br>
<br>
I'm wondering if there is anyone in this community with experience
doing this kind of thing.<br>
<br>
- Ken Seehart<br>
<br>
</body>
</html>