2008-06-03

calculator with LP

I finally have seen the goal of this programming!, namely making a calculator program using knowledge of language processor I have studied.
However, this program has still a lot of errors, so I will brush up tomorrow.
This program is a calculator which can run along this specification below.

1. can use operands: +, -, *, /, %
2. can use Gauss's integer using branckets
3. can change priority of operation using parenthsis
4. can assign value to a valuable structured by alphabets


The specification is implemented by this syntax rule below.

expression = ['-'] term {('+'|'-') term }
term = primary {('*'|'/'|'%') primary }
primary = character | figure | '(' expression ')' | '[' expression ']'
character = ID | ID '=' expression
figure = {number} ['.' {number}]
number = 0|1|2|3|4|5|6|7|8|9
ID = a|b|...|y|z|A|B|...|Y|Z


Finally, I have implemented it so far, as this draft program below.
I feel I will be able to finish it including report!

* To see the source of "calculator.c", please visit the following page.
https://github.com/yasulab/calculator-with-lp

2 件のコメント:

Unknown さんのコメント...

When I see your profile, あい しんく there is something wrong.
YES! You're right!
Your 趣味にある Basket ball must be Basketballの間違い.
No space is needed. I'm also Basketball fan, so I can't stop saying this.

Soreto 君のブログの内容が高度すぎて、分からない。OSなんて、作れるんだねぇ、感心感心。

yasulab さんのコメント...

Oh, that's right! thank you for letting me know it!

あばうと what あい posted...

む~、今度から分かりやすいように書いてみます ASAP if i have time.