Hello,

 

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.

 

Thanks in advance,

-Phillip

 

e.g. for example

 

__GenericLanguage__

 

$var = 10

$var1 = "variable1"

@var2 = [1,2,3]

%var3 = {'key1'=>'value1', 'key2'=>'value2}

 

__Translate-to-SchemeLanguage__

 

Define var1 = variable1

Define var2 = '(1 2 3)

...

 

__Translate-to-TCLLanguage__

 

Set var1 variable

 

Reply via email to