Mail Archives: djgpp/1997/02/14/04:17:59
> Hi!
>
> I've a big problem. I wan't to write a getpixel routine for my own BASIC
> interpreter GBasic, using BISON. The problem is, i don't know how to
> define a BISON function that returns a value.
>
> The Syntax should be like:
>
> a = getpixel 100, 100
> I tried
>
> | GETPIXEL expression',' expression,
> that won't work, just like
> | expression '=' GETPIXEL expression',' expression.
^ space here
Does your lexer separate the tokens properly?
Your left hand side must be something like an identifier
and you should have a syntax definition for an assignment
like:
assignment: identifier '=' function
{ $1 = $3; }
function: GETPIXEL expression ',' expression
{ $$ = getpixel($2,$4); }
>
> Can somebody please help me?
>
> ---
> Gunnar Beushausen
> GBeushausen AT t-online DOT de
> http://www.hof.de/~gbasic
>
--
Chris Christoph P. U. Kukulies kuku AT gil DOT physik DOT rwth-aachen DOT de
- Raw text -