Related articles |
---|
coco/r of some problem s9134143@pu.edu.tw (113) (2005-04-11) |
Re: coco/r of some problem Meyer-Eltz@t-online.de (Detlef Meyer-Eltz) (2005-04-16) |
From: | "113" <s9134143@pu.edu.tw> |
Newsgroups: | comp.compilers |
Date: | 11 Apr 2005 00:11:05 -0400 |
Organization: | HiNetNews |
Keywords: | tools, question |
Posted-Date: | 11 Apr 2005 00:11:05 EDT |
hello,
i' m testing coco/r
but my code can't run coco/r.
give a data .
ex: tmp.txt
5+6=
i need show answer.
but i can't do it .
help~~!!
/******************************************/
$c
COMPILER IC
CHARACTERS
digit = "0123456789" .
TOKENS
num = digit {digit}.
PRODUCTIONS
IC = { Expression "=" }.
Expression = (. int tmp,tmp2,total;.)
num
{ "*" num (.total = tmp2 + tmp; printf("%d",numSym);.)
| "-" num (.total = tmp2 - tmp; printf("%d",numSym);.)} .
END IC.
/******************************************/
Return to the
comp.compilers page.
Search the
comp.compilers archives again.