help: defining grammer?
[email protected] ("Prentice, Phillip R") Mon, 25 Oct 2004 16:10:03 -0700
| Newsgroups | perl.recdescent |
|---|---|
| Message-ID | <0900DAC19AE74A4582F858159B13D3D10CEB9AF3@fmsmsx406.amr.corp.intel.com> |
------_=_NextPart_001_01C4BAE7.C2C3FB0C
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hello,
=20
I was wondering if anyone could help me begin to write some grammer for
a conversion project. I basically have a generic language where
variables, arrays, and hash's are defined. I want these variables to be
translated to a tool specific datastructure, i.e TCL, scheme, etc. I am
assuming I would have to create a different set of grammar(s) for each
language I want the variables translated to. However, I am having
trouble defining the grammar for parsing the genericLanguange. Could
you help me get started by showing me how I would go about parsing the
below 3 structures in the GenericLangauge section below. I would
appreciate any insight or suggestions.
=20
Thanks in advance,
-Phillip
=20
e.g. for example
=20
__GenericLanguage__
=20
$var =3D 10
$var1 =3D "variable1"
@var2 =3D [1,2,3]
%var3 =3D {'key1'=3D>'value1', 'key2'=3D>'value2}
=20
__Translate-to-SchemeLanguage__
=20
Define var1 =3D variable1
Define var2 =3D '(1 2 3)
...
=20
__Translate-to-TCLLanguage__
=20
Set var1 variable
=20
------_=_NextPart_001_01C4BAE7.C2C3FB0C--