Exchange parameter, How? (Alexander Dong)
Sat, 24 Jun 1995 04:29:10 GMT

          From comp.compilers

Related articles
Exchange parameter, How? (1995-06-24)
Re: Exchange parameter, How? (1995-06-26)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Alexander Dong)
Keywords: lex, yacc, question, comment
Organization: Technische Hochschule Darmstadt
Date: Sat, 24 Jun 1995 04:29:10 GMT
Status: RO


We have a special language.
This is the function declaration:

function_declaration: function_name

| parameters ',' one_parameter
| one_parameter


So this language is simular to C. A function is like:

We want to write a program, which can exchange the parameters for us.
that is: function(b,a,d,c);

We are going to use LEX and YACC to do this. But we don't have the complete
grammar from this language. Is there a simple way to do this using lex & yacc
without to write the whole grammar?

Thanks very much!
Alexander Dong
[You can probably do well enough by just fiddling things that look like
function calls, looking lexically for a name followed by an open paren.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.