the i() and v() function application have special semantics
This commit is contained in:
parent
53ac5a888a
commit
73c9cce851
|
|
@ -1,3 +1,7 @@
|
|||
2011-08-20 Robert Larice
|
||||
* src/frontend/parse-bison.y :
|
||||
the i() and v() function application have special semantics
|
||||
|
||||
2011-08-20 Robert Larice
|
||||
* src/maths/fft/Makefile.am ,
|
||||
* visualc/vngspice.vcproj :
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
%{
|
||||
/*
|
||||
* (compile (concat "bison " buffer-file-name))
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -75,7 +78,7 @@
|
|||
* manifests my expectation, and will issue a `warning' when not met
|
||||
*/
|
||||
|
||||
%expect 2
|
||||
%expect 3
|
||||
|
||||
%token <num> TOK_NUM
|
||||
%token <str> TOK_STR
|
||||
|
|
@ -144,6 +147,18 @@ exp:
|
|||
| '-' exp %prec NEG { $$ = mkunode(PT_OP_UMINUS, $2); }
|
||||
| '~' exp { $$ = mkunode(PT_OP_NOT, $2); }
|
||||
|
||||
| TOK_STR '(' TOK_STR ')' {
|
||||
char c = tolower($1[0]);
|
||||
if((c == 'i' || c == 'v') && $1[1] == '\0') {
|
||||
char buf[BSIZE_SP];
|
||||
sprintf(buf, "%s(%s)", $1, $3);
|
||||
$$ = mksnode(buf);
|
||||
} else {
|
||||
$$ = mkfnode($1, mksnode($3));
|
||||
}
|
||||
if(!$$) YYABORT;
|
||||
}
|
||||
|
||||
| TOK_STR '(' exp ')' { $$ = mkfnode($1, $3); if(!$$) YYABORT; }
|
||||
|
||||
| exp '=' exp { $$ = mkbnode(PT_OP_EQ, $1, $3); }
|
||||
|
|
|
|||
Loading…
Reference in New Issue