[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Question: programmable calculator (help for a newbie)
From: |
Julián Calderón Almendros |
Subject: |
Question: programmable calculator (help for a newbie) |
Date: |
Thu, 13 Nov 2003 13:18:51 +0100 |
The scheme of the grammar was more or less :
____________________________________________________________________________
____
%%
input:
| input line
;
line: TK_EOL
| expression TK_EOL
| def_funct TK_EOL
;
expression: value
| TK_OPEN expression TK_BINARY_OPERATION
TK_VALUE TK_CLOSE
| TK_OPEN TK_UNARY_PREFIX_OPERATION expression
TK_CLOSE
| TK_OPEN expression TK_UNARY_SUFIX_OPERATION
TK_CLOSE
;
value: TK_NUM
| TK_VAR
| TK_EVAL_FUNCTION TK_FUNCTION TK_OPEN lst_args
TK_CLOSE
;
...
;
def_funct: TK_FUNCT_NAME TK_OPEN formal_lst_args TK_ASIGNATION
expression
;
...
;
%%
____________________________________________________________________________
____
My only problem is: How do I evaluate a function? I take the expression of
the function and I puts it into one string and that into a map<string
name_of_function,string expresion_of_function>. I don't know if the problem
idea is well expressed because my english is very bad.
Thanks on advance.
- Question: programmable calculator (help for a newbie),
Julián Calderón Almendros <=