[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bison: Grammar for function definitions...
From: |
Hans Aberg |
Subject: |
Re: Bison: Grammar for function definitions... |
Date: |
Sat, 17 May 2008 20:20:42 +0200 |
On 17 May 2008, at 17:08, Geten wrote:
I am little more than a beginner in writing bison specifications
and now I
have stumbled on some problems. What I want to do is to write
grammar to
recognize a function definition
...
A code example:
function helloWorld(int p1, int p2) : bool
int a = p1;
int b = p2;
...
What would a grammar that handled that look like?
It seems you want to settle for a C/C++ like grammar, so you might
look into the standards of these. There is a Yaccable (so it is
Bisonable) one for C++ here:
http://www.parashift.com/c++-faq-lite/compiler-
dependencies.html#faq-38.11
Also, you might try the Usenet newsgroup comp.compilers.
Hans Aberg