Type *t;
}
-%type <n> expr
+%type <n> expr optexpr
+%type <sym> optsym
%type <t> type
+%type <str> probe
%token <sym> TSYM
%token <num> TNUM
stat: expr { addstat(STATEXPR, exprcheck($1, 0)); }
| TPRINT { addstat(STATPRINT); } pelist
| TPRINTF { addstat(STATPRINTF); } pelist
-
+| '@' optsym '[' expr ']' '=' TSYM '(' optexpr ')' { addstat(STATAGG, $2, $4, $7, $9); }
+optsym: TSYM | { $$ = nil; }
+optexpr: expr | { $$ = nil; }
pelist:
'(' ')'
| TSTRING { $$ = type(TYPSTRING); }
probes:
- TSYM { addprobe($1->name); }
- | probes ',' TSYM { addprobe($3->name); }
+ probe { addprobe($1); }
+ | probes ',' probe { addprobe($3); }
+probe:
+ TSYM { $$ = $1->name; }
+ | TSTR { $$ = $1; }
%%